<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<title>ajaxed API</title>
<link rel="shortcut icon" href="/ajaxed/console/documentor/icon.png" type="image/ico">
<meta name="Generator" content="ASP Documentor">
<meta name="description" content="ASP Documentor - documentation for classic ASP (VBScript)"><script src="/ajaxed/js/prototype.js"></script><link rel="stylesheet" type="text/css" href="/ajaxed/console/documentor/code_highlight.css"><script src="/ajaxed/console/documentor/highlight/highlight.js"></script><script>
					hljs.initHighlightingOnLoad('html', 'vbscript', 'css', 'javascript');
				</script><style>
					body {
						padding:0px; margin:0px;
					}
					* {
						font-size:14px;
						font-family:tahoma;
					}
					em {
						font-family:courier new;
						font-style:normal;
					}
					.comment {
						color:#008000 !important;
					}
					code, code * {
						font-family:courier new;
						color:#0B7391;
						font-size:9pt !important;
						margin-bottom:0px !important;
					}
					code {
						display:block;
						overflow:auto;
						margin-top:3px;
						padding:5px 3px 3px 20px;
					}
					code .ssi-code {
						background:#EFEFEF;
					}
					#menu {
						position:absolute;
						right:10px;
						width:200px;
					}
					body>#menu {
						position:fixed;
					}
					.menuItem {
						margin-bottom:5px;
						font-weight:bold;
					}
					.label {
						font-weight:bold;
						padding-right:2em;
					}
					.cDescription, .cDescription * {
						font-size:16px;
						margin-bottom:10px;
					}
					h1 {
						background-color:#8DB2FF;
						padding:5px;
						margin:15px 0px;
					}
					h2 {
						background-color:#DDD;
						font-size:14px;
						font-weight:bold;
						padding:4px;
						margin-bottom:0;
						border: 1px solid #bbbbbb;
					}
					.method {
						margin:5px 0px;
					}
					.table {
						width:100%;
						border-collapse:collapse;
					}
					.table td, .table th {
						border:1px solid #eee;
						text-align:left;
					}
					.table td {
						padding:8px;
					}
					legend {
						font-size:20px;
						font-weight:bold;
					}
					fieldset {
						padding:10px;
						margin:10px 0;
					}

					.type, .type * {
						font-family:courier;
					}
					.cDescription {
					}
					.mdetails {
						padding:1em;
						margin-top:0.5em;
						border:1px solid #aaa;
						background-color:#FBFBFB;
					}
					.button {
						width:70px;
						padding:2px;
						font-family:tahoma;
					}
					
					a:hover, a:link, a:visited, a:active {
						color:#0000FF;
					}
					.obsolete, .obsolete *, .obsolete a:link, .obsolete a:visited, .obsolete a:active, .obsolete a {
						white-space: nowrap;
						font-weight: normal;
						color:#E10000;
						padding-right:0.5em;
					}
					.default {
						font-style:italic;
					}
					.methods a {
					}
					.param {
						margin-bottom:1em;
						padding-bottom:0.2em;
					}
					.paramName {
						color:#AE008F;
						font-weight:bold;
					}
					.returnName {
						color:#000;
						text-decoration:underline;
						font-weight:bold;
					}
					.return {
						margin-top:0.7em;
					}
					
					/* this is just for Firefox */
					html>body #content {
					}
					
					.class {
						width:680px;
						text-align:left;
					}
					
					.list {
						list-style-position: outside;
						margin:1em 0em 1em 2em;
						padding:0px;
						list-style-type:disc;
					}
					.alias {
						color:#aaa;
						margin-top:6px;
					}
				</style>
<style media="print">
					body {
						overflow:auto;
					}
					.notForPrint {
						display:none;
					}
					.alwaysPrint {
						display:block;
					}
					.class {
						width:auto;
						page-break-before:always;
					}
					fieldset {
						border:0px;
					}
					#content {
						overflow:auto;
						height:auto;
					}
					#menu {
						display:none;
					}
					code {
						white-space:auto;
					}
				</style><script>
					function togg(eID) {
						$(eID).toggle();
					}
					function doPrint() {
						$$('.alwaysPrint').each(function(el) {
							el.show()
						});
						window.print()
					}
				</script></head>
<body>
<div id="menu">
<fieldset style="margin:20px;background-color:#fff;">
<div class="menuItem"><a href="#class_1">AjaxedPage</a></div>
<div class="menuItem"><a href="#class_2">Cache</a></div>
<div class="menuItem"><a href="#class_3">Database</a></div>
<div class="menuItem"><a href="#class_4">DataContainer</a></div>
<div class="menuItem"><a href="#class_7">Datatable</a></div>
<div class="menuItem" style="font-weight:lighter;"><a href="#class_5">DatatableColumn</a></div>
<div class="menuItem" style="font-weight:lighter;"><a href="#class_6">DatatableRow</a></div>
<div class="menuItem"><a href="#class_9">Dropdown</a></div>
<div class="menuItem" style="font-weight:lighter;"><a href="#class_8">DropdownItem</a></div>
<div class="menuItem"><a href="#class_10">Email</a></div>
<div class="menuItem"><a href="#class_11">JSON</a></div>
<div class="menuItem"><a href="#class_12">Library</a></div>
<div class="menuItem"><a href="#class_13">Localization</a></div>
<div class="menuItem"><a href="#class_14">Logger</a></div>
<div class="menuItem"><a href="#class_15">MD5</a></div>
<div class="menuItem"><a href="#class_17">RSS</a></div>
<div class="menuItem" style="font-weight:lighter;"><a href="#class_16">RSSItem</a></div>
<div class="menuItem"><a href="#class_18">SHA256</a></div>
<div class="menuItem"><a href="#class_19">StringBuilder</a></div>
<div class="menuItem"><a href="#class_20">StringOperations</a></div>
<div class="menuItem"><a href="#class_21">TestFixture</a></div>
<div class="menuItem"><a href="#class_23">TextTemplate</a></div>
<div class="menuItem" style="font-weight:lighter;"><a href="#class_22">TextTemplateBlock</a></div>
<div class="menuItem"><a href="#class_24">Validator</a></div>
<div style="margin-top:20px;"><button type="button" class="button" onclick="doPrint()">Print</button><div style="font-size:10px;margin-top:8px;">
						documented with<br><a href="http://www.webdevbros.net/ajaxed">ASP Documentor</a><br>
						(11/28/2013 2:40:34 AM)
					</div>
</div>
</fieldset>
</div>
<table cellpadding="0" cellspacing="0">
<tr><td style="padding-left:20px;">
<div id="content"><a name="top"></a><br><br><a name="class_1"></a><fieldset class="class">
<legend>
						Class AjaxedPage <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Represents a page which is located in a physical file (e.g. index.asp). In 95% of cases
each of your pages will hold one instance of this class which defines the page.
For more details check the <a href="/ajaxed/demo/">/ajaxed/demo/</a> for a sample usage.<br><br>
Example of a simple page (e.g. default.asp):
<div class="code"><pre><code>
&lt;!--#include virtual=&quot;/ajaxed/ajaxed.asp&quot;--&gt;
&lt;%
set page = new AjaxedPage
page.title = &quot;my first ajaxed page&quot;
page.draw()
sub main()
    'the execution starts here
end sub
%&gt;
</code></pre></div>
Furthermore each page provides the functionality to call server side ASP procedures
directly from client-side (using the javascript function <em>ajaxed.callback()</em>). A server side procedure can either
return value(s) (all kind of datatypes e.g. <em>bool</em>, <em>recordset</em>, <em>string</em>, etc.) or act as a page part which sends back whole HTML fragments.
In order to return values check <em>return()</em> and <em>returnValue()</em> for further details. Page parts can be used to update an existing page with some
HTML without using a conventional postback. Simply prefix a server side sub with <em>pagePart_</em> and call it with <em>ajaxed.callback(pagePartname, targetContainerID)</em>:
<div class="code"><pre><code>
&lt;% sub pagePart_one() %&gt;
    &lt;strong&gt;some bold text&lt;/strong&gt;
&lt;% end sub
sub main() %&gt;
    &lt;div id=&quot;container&quot;&gt;&lt;/div&gt;
    &lt;button onclick=&quot;ajaxed.callback('one', 'container')&quot;&gt;load page part one&lt;/button&gt;
&lt;% end sub %&gt;
</code></pre></div>
<li class="list"><strong>Refer to the draw() method for more details about the ajaxed.callback() javascript function.</strong></li>
<li class="list">Whenever using the class be sure the <em>draw()</em> method is the first call before any other response is done.</li>
<li class="list">The <em>main()</em> sub must be implemented within each page. You have to implement <em>callback(action)</em> sub if callbacks are used.</li>
<li class="list"><em>init()</em> is always called first (before <em>main()</em> and <em>callback()</em>) and allows preperations to be done before any content is written to the response e.g. security checks and stuff which is necessary before <em>main()</em> and <em>callback()</em>.</li>
<li class="list">After the <em>init()</em> always either <em>main()</em> or <em>callback()</em> is called. They are never called both within one page execution (request).</li>
<li class="list"><em>main()</em> represents the common state of the page which normally includes the page presentation (e.g. html elements)</li>
<li class="list"><em>callback()</em> handles all client requests done with <em>ajaxed.callback()</em>. It needs to be defined with <strong>one parameter</strong> which holds the actual action to perform. As a result the signature should be <em>callback(action)</em>. Example of a valid callback sub</li>
<div class="code"><pre><code>
&lt;%
sub callback(action)
    if action = &quot;add&quot; then page.return(2 + 3)
end sub
%&gt;
</code></pre></div>
<li class="list">Requires Prototype JavaScript library (available at prototypejs.org) but can be loaded automatically by ajaxed (turn on in the config)</li>
<li class="list">access querystring and form fields using page methods:</li>
<div class="code"><pre><code>
&lt;%
sub main()
    id = page.QS(&quot;id&quot;) ' = request.queryString(&quot;id&quot;)
    name = page.RF(&quot;name&quot;) ' = request.form(&quot;name&quot;)
    save = page.RFHas(&quot;save&quot;) 'checks if &quot;save&quot; is not empty
    'automatically try to parse a querystring value into an integer.
    id = str.parse(page.QS(&quot;id&quot;), 0)
end sub
%&gt;
</code></pre></div>
<li class="list">The page also supports a mechanism called "page parts". </li>
<li class="list">use <em>plain</em> property if your page is being used with in an XHR (there you dont need the whole basic structure)</li></div>
<table cellspacing="0" id="info_1" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz - gabru at grafix.at on 2007-06-28 20:32</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 7:05:15 PM</td>
</tr>
</table>
<h2><span onclick="togg('props_1')" style="cursor:pointer">Properties</span> <a href="#class_1" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_1" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">buffering</td>
<td class="type"><span class="type">bool</span></td>
<td>turns the <em>response.buffering </em>on or off (no affect on callback). default = <em>true</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">callbackFlagName</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the name of the callback flag. For advanced use only!&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">callbackType</td>
<td class="type"><span class="type">int</span></td>
<td>GET:  gets the type of the callback (1 = common, 2 = page part). advanced use only!
SET:  sets the type of the callback. Advanced use only!&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">contentType</td>
<td class="type"><span class="type">string</span></td>
<td>contenttype of the response. default = <em>empty</em>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">DBConnection</td>
<td class="type"><span class="type">bool</span></td>
<td>indicates if a database connection should be opened automatically for the page.
If yes then a connection for the default database (default database is the one configured with <em>AJAXED_CONNSTRING</em> config) will be established and can be used
within the <em>init()</em>, <em>callback()</em> and <em>main()</em> procedures. default = <em>false</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">debug</td>
<td class="type"><span class="type">bool</span></td>
<td>turns debugging on of. default = <em>false</em>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">defaultStructure</td>
<td class="type"><span class="type">bool</span></td>
<td>Should the header and the footer be generated automatically by the Page itself?
if <em>true</em> then it will <strong>always</strong> (ignoring all other header/footer settings) load a default <em>header.asp</em> and <em>footer.asp</em> which holds the common HTML elements
like <em>html</em>, <em>body</em>, a <em>doctype</em>, etc. This is useful when you dont really care about an own structure but want a valid page structure.
e.g. the ajaxed console uses this. If false then the <em>header.asp</em> and <em>footer.asp</em> from <em>/ajaxedConfig</em>
is loaded unless <em>headerFooter</em> property is set. default = <em>false</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">headerFooter</td>
<td class="type"><span class="type">array</span></td>
<td>The procedures which should be executed for the header and the footer instead of loading the
<em>header.asp</em> and <em>footer.asp</em> from the config. Useful if you need more headers and footers within one website
e.g. site and backend. This example presumes a <em>pageHeader</em> and a <em>pageFooter</em> sub in your code (usually in some custom global config file):
<div class="code"><pre><code>&lt;% page.headerFooter = array(&quot;pageHeader&quot;, &quot;pageFooter&quot;) %&gt;</code></pre></div>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">jsEngine</td>
<td class="type"><span class="type">string</span></td>
<td>Name of the javascript engine. default = 'prototype'&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">loadJS</td>
<td class="type"><span class="type">bool</span></td>
<td>should JS library be loaded. Turn this off if you've done it manually (e.g. in your <em>header.asp</em>). default = <em>true</em>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">onlyDev</td>
<td class="type"><span class="type">bool</span></td>
<td>should the page only be rendered on the development environment? default = <em>false</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">plain</td>
<td class="type"><span class="type">bool</span></td>
<td>indicates if the page should be a plain page. means that no header and footer is rendered.
Useful for page which are actually only parts of pages and loaded with an XHR. default = <em>false</em>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">title</td>
<td class="type"><span class="type">string</span></td>
<td>title for the page (useful to use within the header.asp)&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_1')" style="cursor:pointer">Methods</span> <a href="#class_1" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_1" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDAFA2BG" onclick="togg('mdetails_1IDAFA2BG')">ajaxedHeader
										(params)
									</a></div>
<div class="mDesc">draws all necessary headers for ajaxed (js, css, etc.)</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAFA2BG">call this method within the HEAD-tag of your header.asp<br><br><div class="param"><span class="paramName"> params</span><span>
														[<span class="type">array</span>]</span><br>not used yet, provide empty array array()</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAGE5BG" onclick="togg('mdetails_1IDAGE5BG')">draw
										()
									</a></div>
<div class="mDesc">Draws the page. Must be the first call on a page</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAGE5BG">The lifecycle is the following after executing draw().
<li class="list">1. setting the HTTP Headers (response)</li>
<li class="list">2. <em>init()</em> (will be only called if exists in your page)</li>
<li class="list">3. <em>main()</em> or <em>callback(action)</em> - action is trimmed to 255 chars (for security reasons),</li>
<em>ajaxed.callback(theAction, func, params, onComplete, url)</em> is the Javascript function
which can be used within your HTML to call serverside functions and page parts. The server side execution can either
return value(s) which are accessible as JSON after execution or it returns a page part (some HTML) to update the current page.
The params are described as followed:
<li class="list"><strong>theAction</strong>: is the action which will be passed as parameter to the server-side callback function e.g. 'do'. if there is a sub starting with <em>pagePart_</em> and the action name (e.g. for action 'do' it would be <em>pagePart_do</em>) then its treated as a page part and returns the subs content.</li>
<li class="list"><strong>func</strong>: the client-side javascript function which will be called after server-side processing finished SUCCESSFULLY. e.g. done. It accepts one parameter which holds either the returned JSON (on common callback) or the html of the page part. In case of a page part callback its possible to use the ID of the container which should be updated. e.g. <em>ajaxed.callback('one', 'content')</em> => this would update the element with ID <em>content</em> with the response of server side <em>pagePart_one()</em> sub</li>
<li class="list"><strong>params</strong> (optional): javascript hash with POST parameters you want to pass to the callback function. They are accessible with e.g. lib.RF on within the callback function. e.g. <em>{a:1,b:2}</em>. if there is a form called <em>frm</em> with your page then all its values are passed as POST values to the callback (if you havent specified any params manually). </li>
<li class="list"><strong>onComplete</strong> (optional): client-side function which should be invoked when the server-side processing has been completed. This is called even if there was an error (same as with native XMLHttpRequest).</li>
<li class="list"><strong>url</strong> (optional): you can specify the url of the page where the callback sub is located. Normally the page itself is called but you could also call callbacks of other pages. Note: use this also if you use callbacks on pages which are recognized as default in a folder. So when a user can call them without specifying the file itself. e.g. /demo/ (bug in iis5: http://support.microsoft.com/kb/216493)</li>
Calling a page part named <em>profile</em> and inserting its content into a HTML element with the ID <em>userProfile</em>:
<div class="code"><pre><code>ajaxed.callback('profile', 'userProfile')</code></pre></div>
Calling a page part named "info" and executing a javascript function "updateInfo" afterwards (which gets the content from the page part as an argument)
We also send a parameter called "id" with the value 1 to the page part:
<div class="code"><pre><code>ajaxed.callback('info', updateInfo, {id: 1})</code></pre></div>
Calling a server side procedure called <em>getSales</em> which gets the current year and current month as parameters.
The javascript function <em>gotSales</em> is executed after the server side processing of <em>getSales</em> has been completed:
<div class="code"><pre><code>ajaxed.callback('getSales', gotSales, {year: &lt;%= year(date()) %&gt;, month: &lt;%= year(date()) %&gt;})</code></pre></div><br><br></div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAFW2BG" onclick="togg('mdetails_1IDAFW2BG')">error
										(msg)
									</a></div>
<div class="mDesc"><span class="obsolete">This method is obsolete.</span>use <em>lib.error()</em> instead.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAFW2BG">
<div class="param"><span class="paramName"> msg</span><br></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAZF2BG" onclick="togg('mdetails_1IDAZF2BG')">execJS
										(JSCode)
									</a></div>
<div class="mDesc">executes a given javascript. input may be a string or an array. each field = a line</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAZF2BG">
<div class="param"><span class="paramName"> JSCode</span><span>
														[<span class="type">string. array</span>]</span><br>your javascript-code. e.g. <em>window.location.reload()</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAJT2BG" onclick="togg('mdetails_1IDAJT2BG')">getLocation
										(format, withQS)
									</a></div>
<div class="mDesc">gets the location of the page you are in. virtual, physical, file or the full URL of the page</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAJT2BG">
<div class="param"><span class="paramName">byVal format</span><span>
														[<span class="type">string</span>]</span><br>the format you want the location be returned: <em>PHYSICAL</em> (c:\web\f.asp), <em>VIRTUAL</em> (/web/f.asp),
<em>FULL</em> (http://web/f.asp) or <em>FILE</em> (f.asp). Full takes the protocol into consideration (https or http)</div>
<div class="param"><span class="paramName"> withQS</span><span>
														[<span class="type">bool</span>]</span><br>should the querystring be appended or not?</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>the location of the executing page in the wanted format</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDADX2BG" onclick="togg('mdetails_1IDADX2BG')">iif
										(i, j, k)
									</a></div>
<div class="mDesc"><span class="obsolete">This method is obsolete.</span></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDADX2BG">use <em>lib.iif</em> instead<br><br><div class="param"><span class="paramName"> i</span><br></div>
<div class="param"><span class="paramName"> j</span><br></div>
<div class="param"><span class="paramName"> k</span><br></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAVU2BG" onclick="togg('mdetails_1IDAVU2BG')">isCallback
										()
									</a></div>
<div class="mDesc">indicates if the state of the page is a callback. advanced usage only!</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAVU2BG">
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br>true if its a callback otherwise false</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDALD2BG" onclick="togg('mdetails_1IDALD2BG')">isPostback
										()
									</a></div>
<div class="mDesc">Returns wheather the page was already sent to server or not.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDALD2BG">It should be the same as the <em>isPostback()</em> from asp.net.<br><br><div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br>posted back (true) or not (false)</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA5R2BG" onclick="togg('mdetails_1IDA5R2BG')">loadCSSFile
										(url, media)
									</a></div>
<div class="mDesc">Loads a specified stylesheet-file</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDA5R2BG">Does not work on <em>callback()</em><br><br><div class="param"><span class="paramName"> url</span><span>
														[<span class="type">string</span>]</span><br>url of your stylesheet</div>
<div class="param"><span class="paramName"> media</span><span>
														[<span class="type">string</span>]</span><br>what media is this stylesheet for. screen, etc.
Leave it <em>empty</em> if its for every media</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDABR2BG" onclick="togg('mdetails_1IDABR2BG')">loadJSFile
										(url)
									</a></div>
<div class="mDesc">Loads a specified javscript-file</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDABR2BG">it will load the file only if it has not been already loaded in the page before.
so you can load the file (more times) and dont have to worry that it might be loaded more than once.
Differentiation between the files is the filename (case-sensitive!).
Does not work on <em>callback()</em><br><br><div class="param"><span class="paramName"> url</span><span>
														[<span class="type">string</span>]</span><br>url of your javascript-file</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDADQ2BG" onclick="togg('mdetails_1IDADQ2BG')">QS
										(name)
									</a></div>
<div class="mDesc">just an equivalent for <em>request.querystring</em>. if empty then returns whole querystring.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDADQ2BG">
<div class="param"><span class="paramName"> name</span><span>
														[<span class="type">string</span>]</span><br>name of the value you want to get. leave it <em>empty</em> to get the whole querystring</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>value from the request querystring collection</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDACP2BG" onclick="togg('mdetails_1IDACP2BG')">QSHas
										(name)
									</a></div>
<div class="mDesc">returns <em>true</em> if a given value exists in the querystring</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDACP2BG">
<div class="param"><span class="paramName"> name</span><span>
														[<span class="type">string</span>]</span><br>name of the value you want to get</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br><em>false</em> if there is no value otherwise <em>true</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA2L2BG" onclick="togg('mdetails_1IDA2L2BG')">QSP
										(name, alternative)
									</a></div>
<div class="mDesc">Combination of <em>QS()</em> and <em>str.parse()</em> which allows you to get & parse a querystring value in one go.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDA2L2BG">See <em>StringOperations.parse()</em> for more details about parsing.
See <em>RFP()</em> for a code example.<br><br><div class="param"><span class="paramName"> name</span><span>
														[<span class="type">string</span>]</span><br>name of the querystring value you want to get</div>
<div class="param"><span class="paramName"> alternative</span><span>
														[<span class="type">string</span>]</span><br>The alternative value for parsing (which also indicates the returned type).</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">variant</span>]
											<br>Value parsed into the type of <em>alternative</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAGN2BG" onclick="togg('mdetails_1IDAGN2BG')">QST
										(name)
									</a></div>
<div class="mDesc">gets the value from the querystrgin and trims it automatically.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAGN2BG">
<div class="param"><span class="paramName"> name</span><span>
														[<span class="type">string</span>]</span><br>name of the querystring parameter you want to get</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>value from the querystring trimmed.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDADB2BG" onclick="togg('mdetails_1IDADB2BG')">return
										(val)
									</a></div>
<div class="mDesc">returns a value on <em>callback()</em></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDADB2BG">Those values are accessible on the javascript callback function defined in <em>ajaxed.callback()</em>.
See also <em>returnValue()</em> if you consider returning more than one value.<br><br><div class="param"><span class="paramName"> val</span><span>
														[<span class="type">variant</span>]</span><br>check <em>JSON.toJSON()</em> for more details</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDABC2BG" onclick="togg('mdetails_1IDABC2BG')">returnValue
										(name, val)
									</a></div>
<div class="mDesc">returns a name value pair on <em>callback()</em>.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDABC2BG">this method can be called more than once because the value will be named and therefore more
values can be returned.<br><br><div class="param"><span class="paramName"> name</span><span>
														[<span class="type">string</span>]</span><br>name of the value</div>
<div class="param"><span class="paramName"> val</span><span>
														[<span class="type">variant</span>]</span><br>refer to <em>JSON.toJSON()</em> method for details</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAXG2BG" onclick="togg('mdetails_1IDAXG2BG')">RF
										(name)
									</a></div>
<div class="mDesc">gets the value from a given form field after postback</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAXG2BG">just an equivalent for request.form. Note: if you expecting the value to be an array
(e.g. more fields with the same name) then use <em>RFA()</em> method.<br><br><div class="param"><span class="paramName"> name</span><span>
														[<span class="type">string</span>]</span><br>name of the value you want to get</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>value from the request-form-collection.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAWI2BG" onclick="togg('mdetails_1IDAWI2BG')">RFA
										(name)
									</a></div>
<div class="mDesc">gets the value of a given form field and treats it as an array (useful if you have more form fields with the same name).</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAWI2BG">this is needed when you give more form fields the same name then its being posted as an array.
Example of two fields with the same name being posted:
<div class="code"><pre><code>
&lt;%
if page.isPostback() then
    str.write(page.RFA(&quot;test&quot;)(0)) 'writes 1
    str.write(page.RFA(&quot;test&quot;)(1)) 'writes 2,3
end if
%&gt;
&lt;input type=&quot;text&quot; name=&quot;test&quot; value=&quot;1&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;test&quot; value=&quot;2,3&quot;&gt;
</code></pre></div><br><br><div class="param"><span class="paramName"> name</span><span>
														[<span class="type">string</span>]</span><br>name of the formfield you want to get</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">array</span>]
											<br>array of string values</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAVH2BG" onclick="togg('mdetails_1IDAVH2BG')">RFE
										(name)
									</a></div>
<div class="mDesc">gets the value from a given form field and encodes the string into HTML.
useful if you want the value be HTML encoded. e.g. inserting into value fields</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAVH2BG">
<div class="param"><span class="paramName"> name</span><span>
														[<span class="type">string</span>]</span><br>name of the value you want to get</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>value from the request-form-collection</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAEO2BG" onclick="togg('mdetails_1IDAEO2BG')">RFHas
										(name)
									</a></div>
<div class="mDesc">returns <em>true</em> if a given value exists in the <em>request.form</em></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAEO2BG">good usage on submit buttons or checkboxes. Example of how to check a checkbox if it has been
checked after posting the form:
<div class="code"><pre><code>
&lt;input type=&quot;checkbox&quot; name=&quot;cb&quot; value=&quot;1&quot; &lt;%= lib.iif(page.RFHas(&quot;cb&quot;, &quot;checked&quot;, &quot;&quot;)) %&gt;&gt;
</code></pre></div><br><br><div class="param"><span class="paramName"> name</span><span>
														[<span class="type">string</span>]</span><br>name of the value you want to get</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br><em>false</em> if there is no value otherwise <em>true</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDASK2BG" onclick="togg('mdetails_1IDASK2BG')">RFP
										(name, alternative)
									</a></div>
<div class="mDesc">Combination of <em>RF()</em> and <em>str.parse()</em> which allows you to get & parse a posted value in one go.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDASK2BG">See <em>StringOperations.parse()</em> for more details about parsing:
<div class="code"><pre><code>
&lt;%
'ensures that a posted value ID always is an integer
ID = page.RFP(&quot;id&quot;, 0)
if ID &lt;= 0 then lib.error(&quot;wrong ID&quot;)
'now we can use it e.g. within the database
set RS = lib.getRS(&quot;SELECT * FROM table WHERE id = {0}&quot;, ID)
%&gt;
</code></pre></div>
<strong>Note:</strong> The same method for querystring values is called <em>QSP()</em><br><br><div class="param"><span class="paramName"> name</span><span>
														[<span class="type">string</span>]</span><br>name of the formfield you want to get</div>
<div class="param"><span class="paramName"> alternative</span><span>
														[<span class="type">string</span>]</span><br>The alternative value for parsing (which also indicates the returned type).</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">variant</span>]
											<br>Value parsed into the type of <em>alternative</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAUJ2BG" onclick="togg('mdetails_1IDAUJ2BG')">RFT
										(name)
									</a></div>
<div class="mDesc">gets the value of a given form field and trims it automatically.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAUJ2BG">
<div class="param"><span class="paramName"> name</span><span>
														[<span class="type">string</span>]</span><br>name of the formfield you want to get</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>value from the request-form-collection</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAHV2BG" onclick="togg('mdetails_1IDAHV2BG')">throwError
										(args)
									</a></div>
<div class="mDesc"><span class="obsolete">This method is obsolete.</span>use <em>lib.throwError</em> instead</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDAHV2BG">
<div class="param"><span class="paramName"> args</span><br></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA3D2BG" onclick="togg('mdetails_1IDA3D2BG')">write
										(value)
									</a></div>
<div class="mDesc">writes a string to the output in the same line</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDA3D2BG">just a wrapper to <em>str.write()</em><br><br><div class="param"><span class="paramName"> value</span><span>
														[<span class="type">string</span>]</span><br>output string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA1E2BG" onclick="togg('mdetails_1IDA1E2BG')">writeln
										(value)
									</a></div>
<div class="mDesc">writes a line to the output</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_1IDA1E2BG">just a wrapper to <em>str.writeln()</em><br><br><div class="param"><span class="paramName"> value</span><span>
														[<span class="type">string</span>]</span><br>output string</div>
</div>
</td>
</tr>
</table>
<h2><span onclick="togg('inits_1')" style="cursor:pointer">Initializations</span> <a href="#class_1" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="inits_1" class="table alwaysPrint" style="display:none; border: 1px solid #888888" cellpadding="3" cellspacing="0" border="0">
<tr>
<th>Config var.</th>
<th>Property</th>
<th>Default</th>
</tr>
<tr style="background-color:#EEEEEE">
<td>
<div class="iConstant">AJAXED_BUFFERING</div>
</td>
<td>
<div class="iProperty">buffering</div>
</td>
<td>
<div class="iDefault">true</div>
</td>
</tr>
<tr>
<td>
<div class="iConstant">AJAXED_DBCONNECTION</div>
</td>
<td>
<div class="iProperty">DBConnection</div>
</td>
<td>
<div class="iDefault">false</div>
</td>
</tr>
<tr style="background-color:#EEEEEE">
<td>
<div class="iConstant">AJAXED_DEFAULT_PAGE_STRUCTURE</div>
</td>
<td>
<div class="iProperty">defaultStructure</div>
</td>
<td>
<div class="iDefault">false</div>
</td>
</tr>
<tr>
<td>
<div class="iConstant">AJAXED_JSENGINE</div>
</td>
<td>
<div class="iProperty">jsEngine</div>
</td>
<td>
<div class="iDefault">"prototype"</div>
</td>
</tr>
<tr style="background-color:#EEEEEE">
<td>
<div class="iConstant">AJAXED_LOADINGTEXT</div>
</td>
<td>
<div class="iProperty">loadingText</div>
</td>
<td>
<div class="iDefault">"loading..."</div>
</td>
</tr>
<tr>
<td>
<div class="iConstant">AJAXED_LOADJS</div>
</td>
<td>
<div class="iProperty">loadJS</div>
</td>
<td>
<div class="iDefault">true</div>
</td>
</tr>
<tr style="background-color:#EEEEEE">
<td>
<div class="iConstant">AJAXED_SESSION_CODEPAGE</div>
</td>
<td>
<div class="iProperty">sessionCodePage</div>
</td>
<td>
<div class="iDefault">false</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_2"></a><fieldset class="class">
<legend>
						Class Cache <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Lets you cache values, objects, etc. It uses the application-variables and
therefore the cache will be shared with all other users. it can cash items which are
identified by an Identifier. The cache will be identified by its name
The cache is protected against memory problems. e.g. huge contents wont be cached,
cache has a limited size. so that the server is not to busy you can define how the caching
works for a specific thing. e.g. you want to cache RSS Feeds then you can setup that the
cache for RSS will hold a maximum of 10 RSS feeds shared. The organisation of the cache is done
automatically if the maximum amount of items is reached</div>
<table cellspacing="0" id="info_2" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz on 2006-11-10 15:46</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:04 PM</td>
</tr>
</table>
<h2><span onclick="togg('props_2')" style="cursor:pointer">Properties</span> <a href="#class_2" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_2" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">interval</td>
<td class="type"><span class="type">string</span></td>
<td>what interval is used to define the expiration of the items. default = h (hour)
allowed values are all values which can be used with dateadd() function. e.g. m = month, etc.&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">intervalValue</td>
<td class="type"><span class="type">string</span></td>
<td>which value of the interval. default = 1&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">maxItemSize</td>
<td class="type"><span class="type">string</span></td>
<td>the maximum size in bytes of an item which will be cached. all items with a size
bigger than this value wont be cached (saving memory on the server). default = 100000
works only if the items are no objects and no arrays&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">maxSlots</td>
<td class="type"><span class="type">string</span></td>
<td>the maximum amount of slots for caching items. default = 10&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">name</td>
<td class="type"><span class="type">string</span></td>
<td>name of the cache you want to create. normally a word which describes what it is caching&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_2')" style="cursor:pointer">Methods</span> <a href="#class_2" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_2" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDAP22BG">clear
										()
									</a></div>
<div class="mDesc">clears the cache.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_2IDAP22BG">
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAB32BG" onclick="togg('mdetails_2IDAB32BG')">getItem
										(identifier)
									</a></div>
<div class="mDesc">gets an item from the cache.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_2IDAB32BG">
<div class="param"><span class="paramName"> identifier</span><span>
														[<span class="type">string</span>]</span><br>identifier of the item within the cache</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">variant</span>]
											<br>empty if no value found, otherwise the value.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAF12BG" onclick="togg('mdetails_2IDAF12BG')">store
										(identifier, item)
									</a></div>
<div class="mDesc">stores an item into the cache. if it already exists then it gets overwritten</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_2IDAF12BG">
<div class="param"><span class="paramName"> identifier</span><span>
														[<span class="type">string</span>]</span><br>the identifier for the item. with this you can get the item afterwards</div>
<div class="param"><span class="paramName"> item</span><span>
														[<span class="type">variant</span>]</span><br>something you want to store within the cache.
Note: Objects does not work!!</div>
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_3"></a><fieldset class="class">
<legend>
						Class Database <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">This class offers methods for database access. All of them are accessible
directly through <em>db</em> without creating an own instance. The AjaxedPage
offers a property <em>DBConnection</em> which automatically opens and closes the default connection
within a page.
<li class="list">the database type is automatically detected but it can also be set manually in the config (<em>AJAXED_DBTYPE</em>).</li>
<li class="list">if the database type could not be detected then the type is <em>unknown</em> and all operations are exectuted as it would be Microsoft SQL Server</li></div>
<table cellspacing="0" id="info_3" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>1.0</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz on 2007-07-16 21:01</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:07 PM</td>
</tr>
<tr>
<td class="label">Staticname:</td>
<td><em>db</em></td>
</tr>
<tr>
<td class="label">Compatible:</td>
<td>Microsoft Sql Server, Microsoft Access, Sqlite, MySQL, PostgreSQL</td>
</tr>
</table>
<h2><span onclick="togg('props_3')" style="cursor:pointer">Properties</span> <a href="#class_3" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_3" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">clientCursor</td>
<td class="type"><span class="type">bool</span></td>
<td>Indicates if the <em>insert()</em> and <em>update()</em> methods should use client cursor (<em>adUseClient</em>) for the used recordset.
This property exists due to a bug with MySQL and UTF-8 text columns. If you have columns of type <em>text</em> in any mySQL table and you want to update it then it will
result in strange chars. Using a client cursor solves this problem. Dont use it in other scenarios as mySQL behaves strange when using a client cursor.
default = <em>false</em> (by default its <em>adUseServer</em>).<br/><br/>(Note: use this property only if you really experience this problem)
More info: http://bugs.mysql.com/bug.php?id=26985 or see also http://dev.mysql.com/tech-resources/articles/vb-cursors-and-locks.html<br/>
Don't forget to set this property back after you have used it.&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">connection</td>
<td class="type"><span class="type">ADODB.Connection</span></td>
<td>holds the database connection&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">dbType</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the type of the currently opened db. access, sqlite, mysql, mssql. unknown if the database type could not be detected. If your database could not be detected then its possible to set the type manually in the config using <em>AJAXED_DBTYPE</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">defaultConnectionString</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the default connectionsstring which can be configured in the ajaxed config (<em>AJAXED_CONNSTRING</em>). if no configured then EMPTY&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">numberOfDBAccess</td>
<td class="type"><span class="type">int</span></td>
<td>GET:  gets the number which indicates how many database accesses has been made till now&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">stringFieldTypes</td>
<td class="type"><span class="type">array</span></td>
<td>GET:  gets the field type numbers of a recordset-field which represent a string value&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_3')" style="cursor:pointer">Methods</span> <a href="#class_3" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_3" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDAZD3BG">close
										()
									</a></div>
<div class="mDesc">Closes the current database connection</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDAZD3BG">
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA0K3BG" onclick="togg('mdetails_3IDA0K3BG')">count
										(tablename, condition)
									</a></div>
<div class="mDesc">gets the recordcount for a given table.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDA0K3BG">
<div class="param"><span class="paramName"> tablename</span><span>
														[<span class="type">string</span>]</span><br>name of the table</div>
<div class="param"><span class="paramName">byVal condition</span><span>
														[<span class="type">string</span>]</span><br>condition for the count. e.g. <em>"deleted = 0"</em>. leave empty to get all</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">int</span>]
											<br>number of records</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDALE3BG" onclick="togg('mdetails_3IDALE3BG')">delete
										(tablename, condition)
									</a></div>
<div class="mDesc">deletes a record from a given database table.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDALE3BG"><li class="list">its required that the id column is named <em>id</em> if condition is used with an <em>int</em> datatype.</li>
<li class="list"><em>id</em> is parsed into a number and only <em>id</em> greater 0 are recognized</li><br><br><div class="param"><span class="paramName"> tablename</span><span>
														[<span class="type">string</span>]</span><br>the name of the table you want to delete the record from</div>
<div class="param"><span class="paramName">byVal condition</span><span>
														[<span class="type">int</span>, <span class="type">string</span>]</span><br>ID of the record or a condition e.g. <em>"id = 20 AND cool = 1"</em>
<li class="list">if condition is a string then you need to ensure sql safety with <em>db.SQLsafe</em> manually.</li></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAZT3BG" onclick="togg('mdetails_3IDAZT3BG')">getRecordset
										(sql)
									</a></div>
<div class="mDesc"><span class="obsolete">This method is obsolete.</span>use <em>getRS()</em> instead.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDAZT3BG">Default method which should be always used to get a LOCKED recordset. Example for use:
<div class="code"><pre><code>set RS = db.getRecordset(&quot;SELECT * FROM user&quot;)</code></pre></div><br><br><div class="param"><span class="paramName">byVal sql</span><span>
														[<span class="type">string</span>]</span><br>Your SQL query</div>
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="http://www.w3schools.com/ado/ado_ref_recordset.asp" target="_blank">Recordset</a>]
											<br>recordset-Object</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAAO3BG" onclick="togg('mdetails_3IDAAO3BG')">getRS
										(sql, params)
									</a></div>
<div class="mDesc">Gets a locked recordset</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDAAO3BG">Gets a LOCKED recordset from the currently opened database. Example of usage:
<div class="code"><pre><code>set RS = lib.getRS(&quot;SELECT * FROM users WHERE name = '{0}'&quot;, &quot;john&quot;)</code></pre></div><br><br><div class="param"><span class="paramName">byVal sql</span><span>
														[<span class="type">string</span>]</span><br>Your SQL query. placeholder for params are {0}, {1}, ... check <em>str.format()</em> for details</div>
<div class="param"><span class="paramName"> params</span><span>
														[<span class="type">array</span>, <span class="type">string</span>]</span><br>parameters for the query which are used within the sql query.
<li class="list">Parameters are made sql injection safe.</li>
<li class="list">Leave <em>empty</em> if no params are needed</li>
<li class="list">provide an array if you have more parameters in your sql</li>
<li class="list">provide a string if you have only one parameter</li></div>
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="http://www.w3schools.com/ado/ado_ref_recordset.asp" target="_blank">recordset</a>]
											<br>recordset with data matching the sql query</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDANS3BG" onclick="togg('mdetails_3IDANS3BG')">getScalar
										(sql, alternative)
									</a></div>
<div class="mDesc">executes a given sql-query and returns the first value of the first row.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDANS3BG">If there is no record available then the alternative will be returned.
The returned value (if available) will be converted to the type of <em>alternative</em>.
Example:
<div class="code"><pre><code>set val = db.getScalar(&quot;SELECT sales FROM table&quot;, 0)</code></pre></div>
This will set the variable <em>val</em> to an integer for sure. If no records found then 0 will be returned otherwise the <em>sales</em> column value of the first record.<br><br><div class="param"><span class="paramName">byVal sql</span><span>
														[<span class="type">string</span>]</span><br>sql-query to be executed</div>
<div class="param"><span class="paramName"> alternative</span><span>
														[<span class="type">variant</span>]</span><br>what should be returned when there is no record returned</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">variant</span>]
											<br>the first value of the result converted to the type of alternative
or the alternative itself if no records available</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAOP3BG" onclick="togg('mdetails_3IDAOP3BG')">getSproc
										(sql, params)
									</a></div>
<div class="mDesc"></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDAOP3BG">Gets an UNLOCKED recordset from the currently opened database, using a stored procedure<br><br><div class="param"><span class="paramName">byVal sql</span><span>
														[<span class="type">string</span>]</span><br>The stored procedure to execute</div>
<div class="param"><span class="paramName"> params</span><span>
														[<span class="type">array</span>, <span class="type">string</span>]</span><br>any paramaters that need to be passed to the stored procedure</div>
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="http://www.w3schools.com/ado/ado_ref_recordset.asp" target="_blank">recordset</a>]
											<br>recordset with data from the stored procedure</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA1U3BG" onclick="togg('mdetails_3IDA1U3BG')">getUnlockedRecordset
										(sql)
									</a></div>
<div class="mDesc"><span class="obsolete">This method is obsolete.</span>use <em>getUnlockedRS()</em> instead</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDA1U3BG">Default method which should be always used to get an UNLOCKED recordset. Example for use:
<div class="code"><pre><code>set RS = db.getUnlockedRecordset(&quot;SELECT * FROM user&quot;)</code></pre></div><br><br><div class="param"><span class="paramName">byVal sql</span><span>
														[<span class="type">string</span>]</span><br>Your SQL query</div>
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="http://www.w3schools.com/ado/ado_ref_recordset.asp" target="_blank">Recordset</a>]
											<br>returns a recordset object (adOpenStatic & adUseClient)</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA5Q3BG" onclick="togg('mdetails_3IDA5Q3BG')">getUnlockedRS
										(sql, params)
									</a></div>
<div class="mDesc"></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDA5Q3BG">Gets an UNLOCKED recordset from the currently opened database. check <em>getRS()</em> documentation<br><br><div class="param"><span class="paramName">byVal sql</span><span>
														[<span class="type">string</span>]</span><br>check <em>getRS()</em> doc</div>
<div class="param"><span class="paramName"> params</span><span>
														[<span class="type">array</span>, <span class="type">string</span>]</span><br>check <em>getRS()</em> doc</div>
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="http://www.w3schools.com/ado/ado_ref_recordset.asp" target="_blank">recordset</a>]
											<br>recordset with data matching the sql query</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAZF3BG" onclick="togg('mdetails_3IDAZF3BG')">insert
										(tablename, data)
									</a></div>
<div class="mDesc">inserts a record into a given database table and returns the record ID</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDAZF3BG"><li class="list">primary key column must be named <em>id</em></li>
<li class="list">the values are not type converted in any way. you need to do it yourself</li>
<li class="list">columns with string values are trimmed if they exceed the maximum allowed length. e.g. if column A only accepts 50 chars it will be trimmed to 50 if it exceeds the length of 50</li><br><br><div class="param"><span class="paramName"> tablename</span><span>
														[<span class="type">string</span>]</span><br>name of the table</div>
<div class="param"><span class="paramName"> data</span><span>
														[<span class="type">array</span>]</span><br>array which holds the columnames and its values. e.g. <em>array("name", "jack johnson")</em>
<li class="list">length must be even otherwise error is thrown</li></div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">int</span>]
											<br>ID of the inserted record</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAAJ3BG" onclick="togg('mdetails_3IDAAJ3BG')">insertOrUpdate
										(tablename, data, condition)
									</a></div>
<div class="mDesc">Inserts (<em>insert()</em>) a record if it does not exist otherwise it updates the record(s) (<em>update()</em>).</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDAAJ3BG">For more details about the functionality refer to the <em>insert()</em> and <em>update()</em> methods. Those are used internally.
<strong>Note:</strong> Table must contain a column named <em>id</em>.<br><br><div class="param"><span class="paramName"> tablename</span><span>
														[<span class="type">string</span>]</span><br>name of the table</div>
<div class="param"><span class="paramName"> data</span><span>
														[<span class="type">array</span>]</span><br>array which holds the columnames and its values.</div>
<div class="param"><span class="paramName">byVal condition</span><span>
														[<span class="type">int</span>, <span class="type">string</span>]</span><br>ID of the record or a condition. Must be provided (cannot be <em>empty</em>)</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">int</span>]
											<br>ID of the record if inserted otherwise <em>0</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAJC3BG" onclick="togg('mdetails_3IDAJC3BG')">open
										(connectionString)
									</a></div>
<div class="mDesc">Opens a database connection with a given connection string</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDAJC3BG"><li class="list">The connection is available afterwards in the <em>connection</em> property</li>
<li class="list">if the connection is already opened then it gets closed a the new is opened</li><br><br><div class="param"><span class="paramName"> connectionString</span><span>
														[<span class="type">string</span>]</span><br>a connection string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAHD3BG" onclick="togg('mdetails_3IDAHD3BG')">openDefault
										()
									</a></div>
<div class="mDesc">Opens the connection to the default database</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDAHD3BG"><li class="list">uses <em>open()</em> for it</li>
<li class="list">throws an error if default connectionstring is NOT configured</li><br><br></div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDALB3BG" onclick="togg('mdetails_3IDALB3BG')">SQLSafe
										(value)
									</a></div>
<div class="mDesc">This function is used to create a legal SQL string that you can use in an SQL statement.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDALB3BG">this is necessary to pass user input directly into a SQL Query
e.g. on a basic login scenario:<div class="code"><pre><code>&lt;% sql = &quot;SELECT * FROM user WHERE login = &quot; &amp; db.SQLSafe(username) %&gt;</code></pre></div>
<li class="list">Note: It may sanitize differently for the different database types.</li>
<li class="list">Warn: Its highliy recommended to additionally validate user input when using parameters directly within the SQL query</li><br><br><div class="param"><span class="paramName"> value</span><span>
														[<span class="type">string</span>]</span><br>the value which should be made "safe"</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>safe value. e.g. <em>'</em> are escaped with <em>''</em>, etc.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAGM3BG" onclick="togg('mdetails_3IDAGM3BG')">toggle
										(tablename, columnName, condition)
									</a></div>
<div class="mDesc">toggles the state of a flag column. if the value is 1 its turned into 0 and vicaversa.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDAGM3BG">useful if you dont delete records but mark them deleted. e.g. <em>toggle("user", "deleted", 10)</em><br><br><div class="param"><span class="paramName"> tablename</span><span>
														[<span class="type">string</span>]</span><br>name of the table</div>
<div class="param"><span class="paramName"> columnName</span><span>
														[<span class="type">string</span>]</span><br>name of the flag column. must be a numeric column accepting 1 and 0</div>
<div class="param"><span class="paramName">byVal condition</span><span>
														[<span class="type">string</span>, <span class="type">int</span>]</span><br>if number then treated as ID of the record otherwise condition for WHERE clause.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDADH3BG" onclick="togg('mdetails_3IDADH3BG')">update
										(tablename, data, condition)
									</a></div>
<div class="mDesc">Updates record(s) in a given database table. Return number of updated records.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_3IDADH3BG"><li class="list">Primary key column must be named <em>id</em> if condition is int</li>
<li class="list">The values are not type converted in any way. you need to do it yourself</li>
<li class="list">Columns with string values are trimmed if they exceed the maximum allowed length. e.g. if column A only accepts 50 chars it will be trimmed to 50 if it exceeds the length of 50</li>
<li class="list">If the condition matches more records then all are updated (batch updating)</li>
<div class="code"><pre><code>
&lt;%
'updates the firstname of all records of the table &quot;person&quot;
'to the value &quot;leila&quot;
updated = db.update(&quot;person&quot;, array(&quot;firstname&quot;, &quot;leila&quot;), empty)
str.writef(&quot;Updated {0} records&quot;, updated)
%&gt;
</code></pre></div><br><br><div class="param"><span class="paramName"> tablename</span><span>
														[<span class="type">string</span>]</span><br>name of the table</div>
<div class="param"><span class="paramName"> data</span><span>
														[<span class="type">array</span>]</span><br>array which holds the columnames and its values. e.g. <em>array("name", "jack johnson")</em>
<li class="list">length must be even otherwise error is thrown</li></div>
<div class="param"><span class="paramName">byVal condition</span><span>
														[<span class="type">int</span>, <span class="type">string</span>]</span><br>ID of the record or a condition e.g. <em>"id = 20 AND cool = 1"</em>
<li class="list">If condition is a string then you need to ensure sql safety with <em>db.SQLsafe</em> manually.</li>
<li class="list">Leave <em>empty</em> if you want to update all records of the table (Note: this could take some time when there are a lot of records).</li></div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">int</span>]
											<br>Number of updated records. <em>0</em> if non updated (e.g. condition didnt match any records)</div>
</div>
</td>
</tr>
</table>
<h2><span onclick="togg('inits_3')" style="cursor:pointer">Initializations</span> <a href="#class_3" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="inits_3" class="table alwaysPrint" style="display:none; border: 1px solid #888888" cellpadding="3" cellspacing="0" border="0">
<tr>
<th>Config var.</th>
<th>Property</th>
<th>Default</th>
</tr>
<tr style="background-color:#EEEEEE">
<td>
<div class="iConstant">AJAXED_DBTYPE</div>
</td>
<td>
<div class="iProperty">p_dbType</div>
</td>
<td>
<div class="iDefault">empty</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_4"></a><fieldset class="class">
<legend>
						Class DataContainer <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Represents generic container which holds data. The container offers different
functions to manipulate the underlying data. The data is bound by reference and therefore all changes will affect the original source.
Ajaxed loads this class automatically so its available everywhere. Example of usage with different datasources:
<div class="code"><pre><code>
&lt;%
'container with an array as datasource
set dc = (new DataContainer)(array(1, 2, 3))

'container with a dictionary as datasource
set dc = (new DataContainer)(lib.newDict(1, 2, 3))

'container for a recordset
set dc = (new DataContainer)(lib.getRS(&quot;SELECT * FROM table&quot;))
%&gt;
</code></pre></div>
After the intantiation its possible to use the different methods on the created DataContainer. Example:
<div class="code"><pre><code>
&lt;%
set dc = (new DataContainer)(array(1, 2, 3))
'check if a given value exists in the container
dc.contains(2)
'its even possible in one line
((new DataContainer)(array(1, 2, 3))).contains(2)
%&gt;
</code></pre></div></div>
<table cellspacing="0" id="info_4" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>michal on 2008-07-12 06:28</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:05 PM</td>
</tr>
<tr>
<td class="label">Compatible:</td>
<td>Array, ADODB.Recordset, Scripting.Dictionary</td>
</tr>
</table>
<h2><span onclick="togg('props_4')" style="cursor:pointer">Properties</span> <a href="#class_4" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_4" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">count</td>
<td class="type"><span class="type">int</span></td>
<td>GET:  Gets the number of items (<em>0</em> means no items).&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">data</td>
<td class="type"><span class="type">array</span>, <a class="type" href="http://www.w3schools.com/ado/ado_ref_recordset.asp" target="_blank">recordset</a>, <a class="type" href="http://www.w3schools.com/asp/asp_ref_dictionary.asp" target="_blank">dictionary</a></td>
<td>gets the underlying data (which was set on initialization). <strong>Never set this property manually!</strong>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">datasource</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  Gets the type of the underlying data. ARRAY, DICTIONARY, RECORDSET&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">first</td>
<td class="type"><span class="type">variant</span></td>
<td>GET:  Gets the first data item. If data is a DICTIONARY then the first <em>key</em> is returned.&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">last</td>
<td class="type"><span class="type">variant</span></td>
<td>GET:  gets the last data item. The last <em>key</em> is returned if data is a DICTIONARY. The last first column is returned if its a RECORDSET. Returns EMPTY if <em>data</em> has no items.&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_4')" style="cursor:pointer">Methods</span> <a href="#class_4" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_4" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDACB4BG" onclick="togg('mdetails_4IDACB4BG')">add
										(item)
									</a></div>
<div class="mDesc">Adds a new item to the Datacontainer and returns the <em>DataContainer</em> instance for method chaining</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_4IDACB4BG">This method allows you to quickly add an item to your DataContainer. In some cases its functionality may not
suite your needs. In that case it is recommended to use the <em>data</em> property explicitly for adding.<br><br><div class="param"><span class="paramName"> item</span><span>
														[<span class="type">array</span>, <span class="type">variant</span>]</span><br>The item you want to add to the datasource (<em>data</em>)
<li class="list">datasource is an <em>array</em>: The array is expanded and the item is added as the last value</li>
<li class="list">datasource is a <em>dictionary</em>: <em>item</em> must be an <em>array</em> of two fields where the first represents the dictionary key and the second its value. <em>Important: </em> The item is not added if the key already exists in the datasource. It UPDATES the item with the new value!</li>
<li class="list">datasource is a <em>recordset</em>: <em>item</em> must be an <em>array</em> where each field holds the value of a recordset column. The order must be the same as in the recordset (no column names can be specified).</li>
Example of <em>item</em> for the three types of datasources
<div class="code"><pre><code>
&lt;%
'creating an empty array DataContainer and adding a value
set dc = (new DataContainer)(array())
dc.add(&quot;some value&quot;)

'same with a dictionary
set dc = (new DataContainer)([&quot;D&quot;](empty))
dc.add(array(1, &quot;first&quot;))

'now with a recordset
set dc = (new DataContainer)([&quot;R&quot;](array( _
    array(&quot;firstname&quot;, &quot;lastname&quot;)
)))
dc.add(array(&quot;John&quot;, &quot;Doe&quot;))

'chaining to add more items in one go
dc.add(array(&quot;Tomy&quot;, &quot;Foo&quot;)).add(array(&quot;Max&quot;, &quot;Muster&quot;))
%&gt;
</code></pre></div></div>
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="#class_4">DataContainer</a>]
											<br>returns the DataContainer instance itself.
This allows adding more records in one go by simply appending another <em>add()</em> call to the method (Method chaining)</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAAG4BG" onclick="togg('mdetails_4IDAAG4BG')">contains
										(val)
									</a></div>
<div class="mDesc">Checks if it contains a given value</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_4IDAAG4BG"><em>dictionary</em> uses the key for comparison.<br><br><div class="param"><span class="paramName"> val</span><span>
														[<span class="type">variant</span>, <span class="type">array</span>]</span><br>The value which should be contained within the container. If an <em>array</em> is provided
then all its values must be contained within the <em>DataContainer</em> in order to return <em>true</em>.</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br><em>true</em> if it contains the value otherwise <em>false</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDACC4BG" onclick="togg('mdetails_4IDACC4BG')" style="font-weight:bold;" title="This is a static method" class="default">newWith
										(datasrc)
									</a></div>
<div class="mDesc">Creates a new <em>DataContainer</em> instance for a given datasource</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_4IDACC4BG">
<div class="param"><span class="paramName">byRef datasrc</span><span>
														[<span class="type">array</span>, <a class="type" href="http://www.w3schools.com/ado/ado_ref_recordset.asp" target="_blank">recordset</a>, <a class="type" href="http://www.w3schools.com/asp/asp_ref_dictionary.asp" target="_blank">dictionary</a>]</span><br>datasource used for the container
<strong>Note:</strong> Only keyset, dynamic or static <em>recordset</em> cursor types are supported. Use <em>db.getUnlockedRS()</em> for it.</div>
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="#class_4">DataContainer</a>]
											<br><em>nothing</em> if the datasource is of a not supported type</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAIE4BG" onclick="togg('mdetails_4IDAIE4BG')">paginate
										(recsPerPage, currentPage, numberOfPages)
									</a></div>
<div class="mDesc">Paginates the data. Useful for e.g. paging bars</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_4IDAIE4BG">Pagination is performed in a way so the current page stays always in the middle.
Example: Lets say we have 100 records and want to page them with 10 records on each page. The current selected page is 5
and we only want to display 3 pages at one time (note: we take the current page from querystring as most pages implement it like this):
<div class="code"><pre><code>
&lt;%
'first we get the current page from querystring and parse it so its always a number
currentPage = str.parse(page.QS(&quot;page&quot;), 0)
pages = ((new DataContainer)(data)).paginate(10, currentPage, 3)
'results in an array which contains the following values
'... 4 5 6 ...
%&gt;
</code></pre></div>
Now we could create a paging bar out of this array now (there are more solutions but this is the most common).
Note: The "..." indicates that there are more pages. In this example there are more before 4th page and more after 6th page.
<div class="code"><pre><code>
&lt;%
link = &quot;&lt;a href=&quot;&quot;default.asp?page={0}&quot;&quot;&gt;{1}&lt;a/&gt;&quot;
str.write(str.format(link, array(1, &quot;&lt;&lt;&quot;)))
str.write(str.format(link, array(currentPage - 1, &quot;&lt; prev&quot;)))
for each p in pages
    p = str.parse(p, 0)
    display = lib.iif(currentPage = p, &quot;&lt;strong&gt;&quot; &amp; p &amp; &quot;&lt;/strong&gt;&quot;, p)
    str.write(lib.iif(p &gt; 0), str.format(link, array(p, display)), &quot;...&quot;)
next
str.write(str.format(link, array(currentPage + 1, &quot;next &gt;&quot;)))
str.write(str.format(link, array(empty, &quot;&gt;&gt;&quot;)))
%&gt;
</code></pre></div>
This code results in a paging which allows us navigating our data by going directly to a page,
jumping to first/last page and moving to next/previous page. Moreover it also displays "..." if there are more pages
and puts the currentpage in a strong-tag.<br><br><div class="param"><span class="paramName"> recsPerPage</span><span>
														[<span class="type">int</span>]</span><br>how many records are being displayed per page. Provide <em>0</em> if all.</div>
<div class="param"><span class="paramName">byVal currentPage</span><span>
														[<span class="type">int</span>]</span><br>holds the current active page.
<li class="list">only numbers greater 0 are recognized (otherwise 1 is used).</li>
<li class="list">use <em>empty</em> to set the current page to the last page</li>
<li class="list">if the number is higher than the actual last page then its adjusted to the last page</li></div>
<div class="param"><span class="paramName"> numberOfPages</span><span>
														[<span class="type">int</span>]</span><br>indicates how many pages should be returned in total (incl. current page)
number should be odd so the currentpage is always centered. If even then it will be rounded up to the next odd number.</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">array</span>]
											<br>returns an array which contains the calculated page numbers in ascending order.
<li class="list">The amount of pages is always equal or or less then <em>numberOfPages</em></li>
<li class="list">It may contain a '...' marker on FIRST position to indicate there are more pages BEFORE those returned</li>
<li class="list">It may contain a '...' marker on LAST position to indicate there are more pages AFTER those returned.</li>
<li class="list">The array is never empty.</li>
<li class="list">It never contains a 0 value</li>
Possible returns:
<div class="code"><pre><code>
There are only 3 pages
[1, 2, 3]
There are pages before the 3rd page and pages after the 5th
[&quot;...&quot;, 3, 4, 5, &quot;...&quot;]
There are only page before or only after
[&quot;...&quot;, 3, 4, 5]
[1, 2, 3, &quot;...&quot;]
only one page
[1]
</code></pre></div></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAAH4BG" onclick="togg('mdetails_4IDAAH4BG')">toString
										(delimiter)
									</a></div>
<div class="mDesc">Returns a string representation of the data</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_4IDAAH4BG"><div class="code"><pre><code>
&lt;%
set d = (new DataContainer)(array(1, 2, 3))
'=&gt; 1 - 2 - 3
str.write(d.toString(&quot; - &quot;))
set d = (new DataContainer)(lib.newDict(empty))
d.data.add 1, &quot;foo&quot;
d.data.add 2, &quot;some&quot;
'=&gt; 1 foo, 2 some
str.write(d.toString(&quot;, &quot;))
'=&gt; 1 -&gt; foo, 2 -&gt; some
str.write(d.toString(array(&quot;, &quot;, &quot; -&gt; &quot;)))
%&gt;
</code></pre></div><br><br><div class="param"><span class="paramName">byVal delimiter</span><span>
														[<span class="type">string</span>, <span class="type">array</span>]</span><br>Use a <em>string</em> when the <em>data</em> is an <em>array</em>. In case of
<em>recordset</em> or <em>dictionary</em> you may use an <em>array</em> to add an delimiter for columns (in case of a <em>recordset</em>) or
<em>key</em> and <em>item</em> (in case of a <em>dictionary</em>). If a <em>string</em> is used on <em>dictionary</em> or <em>recordset</em> then
the second delimiter is a whitespace by default.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAKD4BG" onclick="togg('mdetails_4IDAKD4BG')">unique
										(caseSensitive)
									</a></div>
<div class="mDesc">Removes all duplicates from the data. Changes the underlying <em>data</em>. Only for <em>array</em> yet.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_4IDAKD4BG"><li class="list">If not case sensitive then duplicate values will be represented by the first match</li>
<li class="list">Order of data items stays the same</li><br><br><div class="param"><span class="paramName"> caseSensitive</span><span>
														[<span class="type">bool</span>]</span><br>should the uniquness be case sensitive.</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">array</span>]
											<br>also returns the new generated array</div>
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_7"></a><fieldset class="class">
<legend>
						Class Datatable <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Represents a control which uses data based on a SQL query and renders it as a data table.
The whole datatable is represented as a html table and contains rows (records) and columns (columns defined in the SQL query).
Columns (<em>DatatableColumn</em> instances) must be added to the table. Columns are auto generated if none are defined by the client.
Datatable contains the following main features which makes it a very powerful component:
<li class="list">only a SQL query is needed as the datasource. All columns which are exposed in the query can be used within the table.</li>
<li class="list">supports sorting & pagination</li>
<li class="list">full text search can be applied</li>
<li class="list">TODO: quick deletion of records</li>
<li class="list">TODO: export of the data to all kind of different formats</li>
<li class="list">TODO: all user settings (sorting orders, current page, ...) are remembered during the session. This makes bulk editing easier for users.</li>
<li class="list">optimized for printing</li>
<li class="list">it is loaded with a default style but styles can be adopted to own needs and custom application design</li>
<li class="list">uses ajaxed StringBuilder so it works also with large sets of data</li>
<li class="list">For better performance and nicer user experience all requests are handled with ajax (using pagePart feature of ajaxed)</li>
<li class="list">offers the possibility to change properties during runtime (hide/disable rows, change styles, change data, ...).</li>
Full example of a fsimple Datatable which shows all users of an application (columns are auto detected):
<div class="code"><pre><code>
&lt;%
set dt = new Datatable
set page = new AjaxedPage
page.draw()

sub init()
    dt.sql = &quot;SELECT * FROM user&quot;
    dt.sort = &quot;firstname&quot;
end sub

sub callback(a)
    dr.draw()
end sub

sub main()
    dt.draw()
end sub
%&gt;
</code></pre></div>
As you can see in the example its necessary to draw the datatable in the main and the callback sub.
Thats needed because all the sorting, paging, etc. is done with AJAX using ajaxed callback feature (pageParts).
Setting the properties of the datatable must be done within the pages <em>init()</em> sub (which is executed before <em>callback</em> and <em>main</em>).
In most cases its necessary to decide which columns should be used. Therefore columns must be added manually using <em>newColmn()</em> metnod:
<div class="code"><pre><code>&lt;% dt.newColumn(&quot;firstname&quot;, &quot;Firstname&quot;)%&gt;</code></pre></div></div>
<table cellspacing="0" id="info_7" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>michal on 2008-06-06 09:26</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:14 PM</td>
</tr>
<tr>
<td class="label">Requires:</td>
<td><a class="type" href="#class_9">Dropdown</a>, <span class="type">Pageable</span></td>
</tr>
</table>
<h2><span onclick="togg('props_7')" style="cursor:pointer">Properties</span> <a href="#class_7" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_7" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">attributes</td>
<td class="type"><span class="type">string</span></td>
<td>any attributes which will be placed within the table tag which is used for rendering a datatable.&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">col</td>
<td class="type"><a class="type" href="#class_5">DatatableColumn</a></td>
<td>GET:  gets the column which is being currently drawn. (needed when using <strong>onCellCreated</strong> property of the <em>DatatableColumn</em>)&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">columnsCount</td>
<td class="type"><span class="type">int</span></td>
<td>GET:  gets the amount of columns&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">css</td>
<td class="type"><span class="type">string</span></td>
<td>virtual path of the CSS file which should be used for formatting. set <em>empty</em> if no specific file should be used.
by default the ajaxed default styles are used. By creating your own style files its possible to skin the datatable and share the styles with others.
Refer to the <em>datatable.css</em> to see how the styling works (also check the source of a generated datatable to see the classes being used)&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">cssClass</td>
<td class="type"><span class="type">string</span></td>
<td>name of the css class which should be applied to the table-tag&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">customControls</td>
<td class="type"><span class="type">string</span></td>
<td>name of the sub which draws custom controls for the datatable. e.g. if you want to add additional button, etc. with custom functions. takes the current datatable as eventargument.
Example of adding an own print button:
<div class="code"><pre><code>
&lt;%
dt.customControls = &quot;dtCustomControls&quot;
sub dtCustomControls(callerDT) %&gt;
    Please click the button to print:
    &lt;button onclick=&quot;window.print()&quot;&gt;print&lt;/button&gt;
&lt;% end sub %&gt;
</code></pre></div>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">data</td>
<td class="type"><a class="type" href="http://www.w3schools.com/ado/ado_ref_recordset.asp" target="_blank">recordset</a></td>
<td>gets the recordset which has been generated by the SQL query. Can be useful to access it when working with events like e.g. <em>onRowCreated</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">fullsearch</td>
<td class="type"><span class="type">bool</span></td>
<td>enable/disable the fullsearch feature. Lets the user search all columns with keyword(s).
If more words are entered (seperated with space) then all must be found within the record. Matches are highlighted
with the data. Fullsearch is enabled by default.&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">fullsearchValue</td>
<td class="type"><span class="type">array</span></td>
<td>GET:  gets the value which has been used within the fullsearch. It is an ARRAY because it will return each keyword if there are more (separated with space)&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">ID</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the datatables ID (id attribute of the table-tag). unique within the calling page&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">name</td>
<td class="type"><span class="type">string</span></td>
<td>Required if you want to preserve the datatables state (paging, sorting, ..) during the users session.
Provide a unique name for your datatable instance. (it must be unique within your calling page. e.g. if <em>mypage.asp</em> contains 2 datatable instances then each of them must have a unique name).
Why would you want to preserve the state? Check this: Your datatable contains a lot of data, the user customizes its view (sorting, paging, ...), leaves the page and then comes back. Now he
has to customize the datatable again. But if you preserve the state then the settings are still remembered when he comes back.
Leave <em>empty</em> if you don't want to preserve the state. default = <em>empty</em>.&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">nullSign</td>
<td class="type"><span class="type">string</span></td>
<td>a sign which will be shown if a data value is <em>null</em>. default = <em>empty</em>. (The data cell gets a <em>axdDTNull</em> css class if it contains a null)&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">onRowCreated</td>
<td class="type"><span class="type">string</span></td>
<td>name of the <strong>sub</strong> you want to execute when a row is created. it is raised before it will be drawn.
eventargument is the current Datatable instance. You can access the current row with the <em>row</em> property. Example of how to disable and mark all rows which contain a deleted record with the class "deleted":
<div class="code"><pre><code>
&lt;%
dt.onRowCreated = &quot;onRow&quot;
sub onRow(callerDT)
    callerDT.row.disabled = callerDT.data(&quot;deleted&quot;) = 1
    if callerDT.data(&quot;deleted&quot;) = 1 then callerDT.row.class = &quot;deleted&quot;
end sub
%&gt;
</code></pre></div>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">pkColumn</td>
<td class="type"><span class="type">string</span>, <span class="type">int</span></td>
<td>name (or index) of the column which holds the primary key (uniquely identifies each record). Must be a numeric column! by default its the first column. Used for e.g. selection of records&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">recordLink</td>
<td class="type"><span class="type">string</span></td>
<td>if given then each cells content will be surrounded by an a href tag whose href attribute will contain this link. Perfect if you want to make whole rows clickable quickly.
<em>{field_name}</em> represents a placeholder for a data column value within your link where <em>field_name</em> must be replaced with the actual field name which has been selected.
Example of a link: <em>user.asp?i={id}</em> (which means that the ID columns value will be passed into the user.asp file as a parameter called i).
The link can be deactivated for specified columns by setting the <em>enableLink</em> property to <em>false</em>.
Note: Only letters, numbers and underscores are allowed for the placeholders.&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">recordLinkF</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the link (if any specified with <em>recordLink</em>) for the current record (placeholders replaced). only available during runtime.&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">recsPerPage</td>
<td class="type"><span class="type">int</span></td>
<td>how many records should be displayed per page. default = 100 (0 = no paging)&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">row</td>
<td class="type"><span class="type">DatabaseRow</span></td>
<td>GET:  gets the row which is being currenly drawn. Useful when using <em>onRowCreated</em>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">selection</td>
<td class="type"><span class="type">string</span></td>
<td>SET:  sets if it should be possible to select records (checkbox/radio button is automatically placed in front of each record). use <em>"single"</em> to allow selection of one record (radiobutton) or <em>"multiple"</em> for the selection of more records (checkboxes). default = EMPTY. Name of the checkbox/radio is the ID of the datatable (needed if you do POST it with a form) and value is the value of the pkColumn.
GET:  gets the records selection type.&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">sort</td>
<td class="type"><span class="type">string</span></td>
<td>indicates how the data should be sorted (ORDER BY part of the SQL). on sorting this property is changed (thus its possible to access it during runtime and get the actual sort).
e.g. <em>"lastname"</em> or <em>"created_on DESC"</em>, etc.&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">sorting</td>
<td class="type"><span class="type">bool</span></td>
<td>should it be possible to sort the data? default = <em>true</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">sql</td>
<td class="type"><span class="type">string</span></td>
<td>SQL query which gets all the data. Paging, etc. is done by the control itself so
provide only the query which returns all records. Note: no <em>ORDER BY</em> clause (use <em>sort</em> property for this)&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_7')" style="cursor:pointer">Methods</span> <a href="#class_7" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_7" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDAHK5BG" onclick="togg('mdetails_7IDAHK5BG')">draw
										()
									</a></div>
<div class="mDesc">draws the control. Must be called within <strong>main()</strong> and <strong>callback()</strong></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_7IDAHK5BG">draws the datatable with all its previosuly defined columns/filters.
If no columns are defined then the control automatically grabs all columns which are defined within the sql.
It must be called within the <em>main()</em> sub and the <em>callback()</em> sub of the AjaxedPage. All initializations
(setting properties) must be done in the <em>init()</em>.<br><br></div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAXL5BG" onclick="togg('mdetails_7IDAXL5BG')">newColumn
										(cname, caption)
									</a></div>
<div class="mDesc">adds a new column with name and caption and returns it</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_7IDAXL5BG">
<div class="param"><span class="paramName"> cname</span><span>
														[<span class="type">string</span>, <span class="type">int</span>]</span><br>name/index of the column (should exist within the <em>sql</em>)</div>
<div class="param"><span class="paramName"> caption</span><span>
														[<span class="type">string</span>, <span class="type">array</span>]</span><br>caption for the column header. If <em>array</em> then the first value is the caption and the second is the help text.</div>
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="#class_5">DatatableColumn</a>]
											<br>returns an already added column (properties can be changed afterwards).</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAZK5BG" onclick="togg('mdetails_7IDAZK5BG')">sortedBy
										(columnName)
									</a></div>
<div class="mDesc">indicates if the datatable is sorted by a given column name</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_7IDAZK5BG">
<div class="param"><span class="paramName"> columnName</span><span>
														[<span class="type">string</span>]</span><br>name of column you want to check if its sorted</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">int</span>]
											<br><em>empty</em> means its not sorted by this column otherwise <em>ASC</em> or <em>DESC</em></div>
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_5"></a><fieldset class="class">
<legend>
						Class DatatableColumn <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Represents a column of the Datatable. It is identified by a name (must exist in the datatables SQL query).
Use the <em>Datatable.newColumn(name, caption)</em> factory method to add a new column to the datatable.
Assigning the column to a variable allows changing further properties.<br>
Example of adding a column for a database column named <em>firstname</em> and labeling it <em>Firstname</em>.
Furthermore it will use the css class <em>colFirstname</em> (we assume an existing Datatable instance <em>dt</em>):
<div class="code"><pre><code>
&lt;%
set c = dt.newColumn(&quot;firstname&quot;, &quot;Firstname&quot;)
c.cssClass = &quot;colFirstname&quot;
%&gt;
</code></pre></div></div>
<table cellspacing="0" id="info_5" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>michal on 2008-06-06 13:15</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:13 PM</td>
</tr>
<tr>
<td class="label">Friend of:</td>
<td><a class="type" href="#class_7">Datatable</a></td>
</tr>
</table>
<h2><span onclick="togg('props_5')" style="cursor:pointer">Properties</span> <a href="#class_5" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_5" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">caption</td>
<td class="type"><span class="type">string</span></td>
<td>a caption which will be displayed as the columns header&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">cssClass</td>
<td class="type"><span class="type">string</span></td>
<td>gets/sets the css class which should be used for the column. Its being used within the header cells (&lt;th> tags) and the data cells (&lt;td> tags).
With proper css selectors its possible to style the header different than the data cells of a column.
Example with a css class named "colID" (makes the header bold and data cells colored green):
<div class="code"><pre><code>
th.colID {
    font-weight:bold;
}
td.colID {
    color:#0f0;
}
</code></pre></div>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">dt</td>
<td class="type"><a class="type" href="#class_7">Datatable</a></td>
<td>the datatable it belongs to&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">encodeHTML</td>
<td class="type"><span class="type">bool</span></td>
<td>should the data value encode HTML markup? default = <em>true</em>. Set this to false if you want that HTML is recognized within the data cells&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">help</td>
<td class="type"><span class="type">string</span></td>
<td>a help string which can be used to explain the caption (e.g. if its an abbreviation)&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">index</td>
<td class="type"><span class="type">int</span></td>
<td>gets the index of the column. starting with 0 (first column)&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">link</td>
<td class="type"><span class="type">bool</span></td>
<td>should the record link be enabled (if any). default = <em>true</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">name</td>
<td class="type"><span class="type">string</span>, <span class="type">int</span></td>
<td>name/index of the column. must exist in datatables SQL query.&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">nullValue</td>
<td class="type"><span class="type">bool</span></td>
<td>GET:  indicates if the value is actually a NULL value in the database.&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">onCellCreated</td>
<td class="type"><span class="type">string</span></td>
<td>name of the <strong>function</strong> which should be executed just before a data cell of this column will be drawn.
expects one argument which will hold the datatable executing the function. The function must return the value which should be drawn.
The datatable has a col property which holds the current column. using its value property its possible to acces the data value.
Example of how to change the data cell value using other data columns from the current row
(e.g. making the text red if the record is deleted):
<div class="code"><pre><code>
&lt;%
function onFirstname(dt)
    color = lib.iif(dt.data(&quot;deleted&quot;) = 1, &quot;#f00&quot;, &quot;#000&quot;)
    onFirstname = &quot;&lt;span style=&quot;&quot;color:&quot; &amp; color &amp; &quot;&quot;&quot;&gt;&quot; &amp; dt.col.valueF &amp; &quot;&lt;/span&gt;&quot;
end function
%&gt;
</code></pre></div>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property" style="font-weight:bold;" title="The default property">value</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the RAW data value of the column when a cell is created. Its always a string. If its a NULL then its been converted into an empty string. Use <em>nullValue</em> property to check if it was NULL. Use this always if you do conditional checks on the data value.&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">valueF</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the FORMATTED data value of the column when a cell is created. This should be used when you render the value on the page (it can contain markup which marks the searches, etc).&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_5')" style="cursor:pointer">Methods</span> <a href="#class_5" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_5" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
</table>
</fieldset><br><br><a name="class_6"></a><fieldset class="class">
<legend>
						Class DatatableRow <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Represents a row in a datatable. Can only be accessed when using
the <em>onRowCreated</em> event of the Datatable. When the event is raised its
possible to access the current row with the <em>row</em> property of the Datatable.
Example of how to mark first 10 records of a datatable as selected using the row's <em>selected</em> property:
<div class="code"><pre><code>
&lt;%
dt.selection = &quot;multiple&quot;
dt.onRowCreated = &quot;onRow&quot;
sub onRow(callerDT)
    callerDT.row.selected = callerDT.row.number &lt;= 10
end sub
%&gt;
</code></pre></div></div>
<table cellspacing="0" id="info_6" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>michal on 2008-06-17 15:56</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:13 PM</td>
</tr>
<tr>
<td class="label">Friend of:</td>
<td><a class="type" href="#class_7">Datatable</a></td>
</tr>
</table>
<h2><span onclick="togg('props_6')" style="cursor:pointer">Properties</span> <a href="#class_6" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_6" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">attributes</td>
<td class="type"><span class="type">string</span></td>
<td>attributes of the &lt;tr&gt;-tag. You can make e.g. whole rows clickable: onclick="window.location.href='someurl.asp'"&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">cssClass</td>
<td class="type"><span class="type">string</span></td>
<td>css class which will be placed within the <em>&lt;tr&gt;</em> tag&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">disabled</td>
<td class="type"><span class="type">bool</span></td>
<td>indicates if the row is disabled or not. disabled does not allow to select the row and it wont be clickable&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">dt</td>
<td class="type"><a class="type" href="#class_7">Datatable</a></td>
<td>the datatable which contains the row&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">ID</td>
<td class="type"><span class="type">int</span></td>
<td>GET:  gets a unique ID of the row. the <em>&lt;tr&gt;</em> tag contains this ID&nbsp;</td>
</tr>
<tr valign="top">
<td class="property" style="font-weight:bold;" title="The default property">number</td>
<td class="type"><span class="type">int</span></td>
<td>GET:  gets the number of the row within the datatable. on paging the number is continously. Good for numbering your records&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">PK</td>
<td class="type"><span class="type">int</span></td>
<td>GET:  gets the primary key value of the rows record&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">selected</td>
<td class="type"><span class="type">bool</span></td>
<td>GET:  indicates if the row is selected or not. keeps state after postback as well. So when user changes the selection it will remember the selection after postback.
SET:&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_6')" style="cursor:pointer">Methods</span> <a href="#class_6" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_6" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
</table>
</fieldset><br><br><a name="class_9"></a><fieldset class="class">
<legend>
						Class Dropdown <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">represents a HTML-selectbox in an OO-approach.
<li class="list">naming and functionallity is based on .NET-control <em>DropdownList</em></li>
<li class="list">easy use with different datasources: <em>recordset</em>, <em>dictionary</em> and <em>array</em></li>
<li class="list">there are 3 different rendering types when using it as a multiple dropdown. e.g. you can render a dropdown where each item has a radiobutton so the user can make only one selection. check <em>multipleSelectionType</em> property for more details</li>
<li class="list">to build a new dropdown create a new instance, set the desired properties and use <em>draw()</em> method to render the dropdown on the page. If the output is needed as a string then <em>toString()</em> can be used</li>
<li class="list">in most cases you need a dropdown with data from the database. in that case you can use <em>getNew()</em> method which quickly creates a dropdown for you. as it is the default method you can simply use it with<div class="code"><pre><code>&lt;% (new Dropdown)(&quot;SELECT * FROM table&quot;, &quot;name&quot;, &quot;selected&quot;).toString() %&gt;</code></pre></div></li>
<li class="list">Example of simply creating a dropdown with all months of a year and the current month selected:<div class="code"><pre><code>&lt;% (new Dropdown)(lib.range(1, 12, 1), &quot;month&quot;, month(date())).toString() %&gt;</code></pre></div></li></div>
<table cellspacing="0" id="info_9" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>1.0</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz - gabru @ grafix.at on 2005-02-01 16:31</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:16 PM</td>
</tr>
<tr>
<td class="label">Postfix:</td>
<td>DD</td>
</tr>
<tr>
<td class="label">Compatible:</td>
<td>Internet Explorer, Mozilla Firefox</td>
</tr>
</table>
<h2><span onclick="togg('props_9')" style="cursor:pointer">Properties</span> <a href="#class_9" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_9" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">attributes</td>
<td class="type"><span class="type">string</span></td>
<td>additional attributes which go into the <em>&lt;select></em>-element. e.g. onClick, onChange, etc.&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">autoDrawItems</td>
<td class="type"><span class="type">bool</span></td>
<td>defines if each item will be drawn autmatically after the <em>onItemCreated</em>-Event
has been raised. default = <em>true</em>. disabling usefull if you want to add items during the runtime&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">commonFieldText</td>
<td class="type"><span class="type">string</span></td>
<td>text of the common-field. e.g. <em>"--- please select a value ---"</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">commonFieldValue</td>
<td class="type"><span class="type">string</span></td>
<td>value for the common-field. default = 0&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">cssClass</td>
<td class="type"><span class="type">string</span></td>
<td>name of the css-class you want to assign to the control&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">datasource</td>
<td class="type"><span class="type">array</span>, <a class="type" href="http://www.w3schools.com/ado/ado_ref_recordset.asp" target="_blank">recordset</a>, <a class="type" href="http://www.w3schools.com/asp/asp_ref_dictionary.asp" target="_blank">dictionary</a>, <span class="type">string</span></td>
<td>when using recordset be sure
to use <em>Database.getUnlockedRS()</em>
<li class="list">if datasource is a string then it will be recognized as a SQL-query (note: after <em>draw()</em> datasource changes to a recordset)</li>
<li class="list">When using an array as datasource, you should set the <em>valuesDatasource</em> if values are different than the captions</li>
<li class="list">dictionaries values are used as values and the items as the captions for each option</li>
 property. If this is not set,the datasource elements will be used as the values and options for the dropdown&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">dataTextField</td>
<td class="type"><span class="type">string</span>, <span class="type">int</span></td>
<td>field-name of the datasource that provides the text-content for each list-item. if the datasource is a recordset then its the second column by default&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">dataValueField</td>
<td class="type"><span class="type">string</span>, <span class="type">int</span></td>
<td>field-name of the datasource that provides the value for each list-item. if the datasource is a recordset then its the first column by default&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">disabled</td>
<td class="type"><span class="type">bool</span></td>
<td>indicates whether the control is disabled or not. default = false&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">ID</td>
<td class="type"><span class="type">string</span></td>
<td>ID of the control. is generated automatically by default but can be set also.&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">multiple</td>
<td class="type"><span class="type">bool</span></td>
<td>is it a multiple dropdown? default = false&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">multipleSelectionType</td>
<td class="type"><span class="type">int</span></td>
<td>Set this property if you want to change the selectiontype of a multiple dropdown.
Useful if you want to have formatted items, because the dropdown isn't rendered as a SELECT-Element. There are 3 variations:
<li class="list"><em>DD_SELECTIONTYPE_COMMON</em> = its the common one. hold down CTRL to select more</li>
<li class="list"><em>DD_SELECTIONTYPE_MULTIPLE</em> = selection comes with checkboxes (user can select more items).</li>
<li class="list"><em>DD_SELECTIONTYPE_SINGLE</em> = selection comes with radiobuttons. so just one selection is allowed.</li>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">name</td>
<td class="type"><span class="type">string</span></td>
<td>Name of the control&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">onItemCreated</td>
<td class="type"><span class="type">string</span></td>
<td>name of function (sub) which should handle onItemCreated. Event will be raised just before printing the item.&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">selectedValue</td>
<td class="type"><span class="type">array</span>, <span class="type">string</span></td>
<td>SET:  what value(s) is selected. array needed if multiple dropdown
GET:  returns the selected value(s)&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">size</td>
<td class="type"><span class="type">int</span></td>
<td>number of displayed rows if its a multiple dropdown. default = 1. If its not a common-multiple-dropdown
then the size is used as pixels for the height of the dropdown.&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">style</td>
<td class="type"><span class="type">string</span></td>
<td>css-Styles for the control. added to <em>&lt;select style="..."</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">tabIndex</td>
<td class="type"><span class="type">int</span></td>
<td>index of the control. -1 = dont add to the tabindex-collection&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">uniqueID</td>
<td class="type"><span class="type">int</span></td>
<td>GET:  gets a unique ID (scope: the page) of the dropdown&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">valuesDatasource</td>
<td class="type"><span class="type">array</span></td>
<td>if array is used as datasource, please provide an array of same length for values too. If no array is given, values are indexed&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_9')" style="cursor:pointer">Methods</span> <a href="#class_9" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_9" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDAVZ5BG">draw
										()
									</a></div>
<div class="mDesc">draws the dropdown on the page</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_9IDAVZ5BG">
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAH05BG" onclick="togg('mdetails_9IDAH05BG')" style="font-weight:bold;" title="This is a static method" class="default">getNew
										(datasrc, dropdownName, selectedVal)
									</a></div>
<div class="mDesc">helper method which quickly creates a dropdown using a SQL-query</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_9IDAH05BG">first column is used as value for the items and second as the caption<br><br><div class="param"><span class="paramName"> datasrc</span><span>
														[<a class="type" href="http://www.w3schools.com/asp/asp_ref_dictionary.asp" target="_blank">dictionary</a>, <a class="type" href="http://www.w3schools.com/ado/ado_ref_recordset.asp" target="_blank">recordset</a>, <span class="type">string</span>, <span class="type">array</span>]</span><br>datasource for the dropdown</div>
<div class="param"><span class="paramName"> dropdownName</span><span>
														[<span class="type">string</span>]</span><br>name of the dropdown</div>
<div class="param"><span class="paramName"> selectedVal</span><span>
														[<span class="type">string</span>]</span><br>selected value</div>
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="#class_9">Dropdown</a>]
											<br>a ready-to-use dropdown</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAH25BG" onclick="togg('mdetails_9IDAH25BG')">getNewItem
										(itemValue, itemText)
									</a></div>
<div class="mDesc"></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_9IDAH25BG">gets you a new dropdown-item which can be drawn after that.<br><br><div class="param"><span class="paramName"> itemValue</span><span>
														[<span class="type">string</span>]</span><br>value of the item</div>
<div class="param"><span class="paramName"> itemText</span><span>
														[<span class="type">string</span>]</span><br>text of the item</div>
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="#class_8">DropdownItem</a>]
											<br>the created dropdownItem</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAR35BG" onclick="togg('mdetails_9IDAR35BG')">toString
										()
									</a></div>
<div class="mDesc">returns the dropdown as a string</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_9IDAR35BG">
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>returns a string representation of this dropdown</div>
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_8"></a><fieldset class="class">
<legend>
						Class DropdownItem <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">represents an item of the dropdown</div>
<table cellspacing="0" id="info_8" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.2</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz - gabru @ grafix.at on 2005-02-02 15:16</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:16 PM</td>
</tr>
<tr>
<td class="label">Friend of:</td>
<td><a class="type" href="#class_9">Dropdown</a></td>
</tr>
</table>
<h2><span onclick="togg('props_8')" style="cursor:pointer">Properties</span> <a href="#class_8" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_8" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">attributes</td>
<td class="type"><span class="type">string</span></td>
<td>additional attributes&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">dropdown</td>
<td class="type"><a class="type" href="#class_9">Dropdown</a></td>
<td>the dropdown it belongs to.&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">index</td>
<td class="type"><span class="type">int</span></td>
<td>index of the item in the dropdown&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">selected</td>
<td class="type"><span class="type">bool</span></td>
<td>indicates whether the item is selected or not&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">show</td>
<td class="type"><span class="type">bool</span></td>
<td>show the item or not. default = <em>true</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">style</td>
<td class="type"><span class="type">string</span></td>
<td>css-Styles for the item&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">text</td>
<td class="type"><span class="type">string</span></td>
<td>text of the item. refers to the displayed-value of the item&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">title</td>
<td class="type"><span class="type">string</span></td>
<td>title for the option&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">value</td>
<td class="type"><span class="type">string</span></td>
<td>value of the item. refers to <em><option value=""></em>&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_8')" style="cursor:pointer">Methods</span> <a href="#class_8" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_8" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDAYQ5BG">draw
										()
									</a></div>
<div class="mDesc">draws the item using the output of the dropdown</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_8IDAYQ5BG">
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_10"></a><fieldset class="class">
<legend>
						Class Email <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">This class represents an email. It is a generic interface which internally uses
a third party component (automatically detected).
<li class="list">Create a new instance, set the properties and send or use <em>newWith(template)</em> and create a new instance with a template which will set the body and the subject of the email automatically from the <em>TextTemplate</em></li>
<li class="list">You should send an email whereever you want to send an email in your application despite if you dont know if an email component will be installed. </li></div>
<table cellspacing="0" id="info_10" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.9</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz - gabru @ grafix.at on 23.04.2008</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:17 PM</td>
</tr>
<tr>
<td class="label">Compatible:</td>
<td>Dimac JMail.Message, ASPEmail Persists.MailSender, Microsoft cdo.message</td>
</tr>
</table>
<h2><span onclick="togg('props_10')" style="cursor:pointer">Properties</span> <a href="#class_10" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_10" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">allTo</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the email address to which all emails should be sent. Useful on the <em>dev</em> env if you want to pipe all emails to one email address independently of the real recipient(s). This prevents that users would recieve an unwanted email which was send during the development. Can be set using the <em>AJAXED_EMAIL_ALLTO</em> config&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">body</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the body
SET:  sets the body. if HTML is true then the body should be HTML markup&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">component</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the name of the component which will be used for sending (which is supported). empty if there was no supported component found&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">componentsOrdered</td>
<td class="type"><span class="type">array</span></td>
<td>GET:  gets the loading order of the components (only necessary if more email components installed)&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">dispatch</td>
<td class="type"><span class="type">bool</span></td>
<td>indicates if the email should be dispatched when send() is called? default = <em>true</em>. useful to turn off if you only want to simulate sending on your <em>dev</em> env (to keep your inbox empty).&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">errorMsg</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  holds the errormessage if <em>send()</em> failed&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">html</td>
<td class="type"><span class="type">bool</span></td>
<td>GET:  indicates if the emails body will be interpreted as html
SET:  sets the value indicating if the email body should be interpreted as html&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">mailer</td>
<td class="type"><span class="type">object</span></td>
<td>gets the actual mailer object which has been wrapped by Email. Useful if some specific settings have to be made before sending.&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">mailServer</td>
<td class="type"><span class="type">string</span></td>
<td>the host which is responsible for delivery. e.g. IP, hostname&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">mailServerPassword</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the password for the SMTP server.
SET:  sets the password for the SMTP server&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">mailServerUsername</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the username for the SMTP server.
SET:  sets the username for the SMTP server&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">onlyValidEmails</td>
<td class="type"><span class="type">bool</span></td>
<td>indicates if the email addresses (sender & recipient) should be checked for correct syntax? default = <em>true</em>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">recipients</td>
<td class="type"><a class="type" href="http://www.w3schools.com/asp/asp_ref_dictionary.asp" target="_blank">dictionary</a></td>
<td>GET:  gets already added recipients. <em>key</em> = auto ID, <em>item</em> = <em>array(recipientstype, email, name)</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">sendersEmail</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the senders email
SET:  sets the senders email. if only valid emails allowed and its not a valid email then exception is thrown&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">sendersName</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the senders name
SET:  sets the senders name.&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">subject</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the subject
SET:  sets the subject&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">supportedComponents</td>
<td class="type"><span class="type">array</span></td>
<td>GET:  gets the supported mail components&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_10')" style="cursor:pointer">Methods</span> <a href="#class_10" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_10" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDALPMMN" onclick="togg('mdetails_10IDALPMMN')">addAttachment
										(fileName, inline, contentType)
									</a></div>
<div class="mDesc">Adds an attachment. Can be used mutliple times</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_10IDALPMMN">
<div class="param"><span class="paramName"> fileName</span><span>
														[<span class="type">string</span>]</span><br>the name and path of your file on the server (absolute). e.g. <em>c:\www\images\logo.gif</em></div>
<div class="param"><span class="paramName"> inline</span><span>
														[<span class="type">bool</span>]</span><br>if true the attachment will be added as an inline attachment</div>
<div class="param"><span class="paramName"> contentType</span><span>
														[<span class="type">string</span>]</span><br>attachments content type. leave empty if you don't want to specify it explicitly</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">int</span>]
											<br>A unique ID that can be used to identify this attachment. This is useful if you are
embedding images in the email's body. Then you need to refer to it with <em>&lt;img src="cid:xxxx"></em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAHMMMN" onclick="togg('mdetails_10IDAHMMMN')">addRecipient
										(recipientsType, email, name)
									</a></div>
<div class="mDesc">Adds a recipient. Can be used multiple times</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_10IDAHMMMN">recipients property holds all added recipients<br><br><div class="param"><span class="paramName"> recipientsType</span><span>
														[<span class="type">string</span>]</span><br>Define the type of recipient: <em>TO</em>, <em>CC</em> or <em>BCC</em></div>
<div class="param"><span class="paramName">byVal email</span><span>
														[<span class="type">string</span>]</span><br>Recipients email. Required! if <em>onlyValidEmails</em> is true then
the recipient is only added if the email is a syntactically valid one</div>
<div class="param"><span class="paramName">byVal name</span><span>
														[<span class="type">string</span>]</span><br>Recipients name. if <em>empty</em> then email is used as name</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br>true if the recipient has been added. false if not.
Its not added if only valid emails are required and the email was not valid.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDABOMMN" onclick="togg('mdetails_10IDABOMMN')">addRecipients
										(recipientType, emails)
									</a></div>
<div class="mDesc">helper which adds more than one recipient seperated by <em>";"</em>. Only email values. Name will be the email</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_10IDABOMMN">
<div class="param"><span class="paramName"> recipientType</span><span>
														[<span class="type">string</span>]</span><br>type of the recipient. <em>TO, CC</em> or <em>BCC</em></div>
<div class="param"><span class="paramName"> emails</span><span>
														[<span class="type">string</span>]</span><br>recipients emails seperated by <em>";"</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAZKMMN" onclick="togg('mdetails_10IDAZKMMN')">emailName
										(aName, anEmail)
									</a></div>
<div class="mDesc">returns a formatted string for a given name and its email address</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_10IDAZKMMN">useful for displaying sender or recipient nicely.<br><br><div class="param"><span class="paramName">byVal aName</span><span>
														[<span class="type">string</span>]</span><br>name to be used</div>
<div class="param"><span class="paramName">byVal anEmail</span><span>
														[<span class="type">string</span>]</span><br>email to be used</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>format: <em>"name" <email@host.com></em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA1CMMN" onclick="togg('mdetails_10IDA1CMMN')" style="font-weight:bold;" title="This is a static method">newWith
										(template)
									</a></div>
<div class="mDesc">creates a new email instance with the content of a given <em>TextTemplate</em></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_10IDA1CMMN">first line of the template is treated as the emails subject and the rest as the body.
Dont forget to load the <em>TextTemplate</em> class for this.<br><br><div class="param"><span class="paramName"> template</span><span>
														[<a class="type" href="#class_23">TextTemplate</a>]</span><br>template which is used within the email.</div>
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="#class_10">Email</a>]
											<br>a ready-to-use email instance where <em>subject</em> and <em>body</em> is set automatically from the given template</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAXIMMN" onclick="togg('mdetails_10IDAXIMMN')" style="font-weight:bold;" title="This is a static method" class="default">quickSend
										(template, recipient)
									</a></div>
<div class="mDesc">sends an email with a given <em>TextTemplate</em> to a given recipient.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_10IDAXIMMN">a helper to quickly send an email. sender is the default one<br><br><div class="param"><span class="paramName"> template</span><span>
														[<a class="type" href="#class_23">TextTemplate</a>]</span><br>template which is used within the email. Refer to <em>newWith()</em> for the details.</div>
<div class="param"><span class="paramName"> recipient</span><span>
														[<span class="type">string</span>, <span class="type">array</span>]</span><br>if string then treated as email otherwise first
value email and second the name</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>error message if could not send otherwise empty</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAHKMMN" onclick="togg('mdetails_10IDAHKMMN')">send
										()
									</a></div>
<div class="mDesc">sends the email message</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_10IDAHKMMN">If sending failed then check <em>errorMsg</em> property for a detailed error<br><br><div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br>true if could be sent otherwise false</div>
</div>
</td>
</tr>
</table>
<h2><span onclick="togg('inits_10')" style="cursor:pointer">Initializations</span> <a href="#class_10" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="inits_10" class="table alwaysPrint" style="display:none; border: 1px solid #888888" cellpadding="3" cellspacing="0" border="0">
<tr>
<th>Config var.</th>
<th>Property</th>
<th>Default</th>
</tr>
<tr style="background-color:#EEEEEE">
<td>
<div class="iConstant">AJAXED_EMAIL_DISPATCH</div>
</td>
<td>
<div class="iProperty">dispatch</div>
</td>
<td>
<div class="iDefault">true</div>
</td>
</tr>
<tr>
<td>
<div class="iConstant">AJAXED_HTML_EMAILS</div>
</td>
<td>
<div class="iProperty">html</div>
</td>
<td>
<div class="iDefault">false</div>
</td>
</tr>
<tr style="background-color:#EEEEEE">
<td>
<div class="iConstant">AJAXED_MAILSERVER</div>
</td>
<td>
<div class="iProperty">mailServer</div>
</td>
<td>
<div class="iDefault">empty</div>
</td>
</tr>
<tr>
<td>
<div class="iConstant">AJAXED_MAILSERVER_PWD</div>
</td>
<td>
<div class="iProperty">mailServerPassword</div>
</td>
<td>
<div class="iDefault">empty</div>
</td>
</tr>
<tr style="background-color:#EEEEEE">
<td>
<div class="iConstant">AJAXED_MAILSERVER_USER</div>
</td>
<td>
<div class="iProperty">mailServerUsername</div>
</td>
<td>
<div class="iDefault">empty</div>
</td>
</tr>
<tr>
<td>
<div class="iConstant">AJAXED_EMAIL_ONLYVALID_EMAILS</div>
</td>
<td>
<div class="iProperty">onlyValidEmails</div>
</td>
<td>
<div class="iDefault">true</div>
</td>
</tr>
<tr style="background-color:#EEEEEE">
<td>
<div class="iConstant">AJAXED_EMAIL_ALLTO</div>
</td>
<td>
<div class="iProperty">p_allTo</div>
</td>
<td>
<div class="iDefault">empty</div>
</td>
</tr>
<tr>
<td>
<div class="iConstant">AJAXED_EMAIL_SENDER</div>
</td>
<td>
<div class="iProperty">sendersEmail</div>
</td>
<td>
<div class="iDefault">empty</div>
</td>
</tr>
<tr style="background-color:#EEEEEE">
<td>
<div class="iConstant">AJAXED_EMAIL_SENDER_NAME</div>
</td>
<td>
<div class="iProperty">sendersName</div>
</td>
<td>
<div class="iDefault">empty</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_11"></a><fieldset class="class">
<legend>
						Class JSON <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Comes up with functionality for JSON (http://json.org) to use within ASP.
Correct escaping of characters, generating JSON Grammer out of ASP datatypes and structures
Some examples (all use the <em>toJSON()</em> method but as it is the class' default method it can be left out):
<div class="code"><pre><code>
&lt;%
'simple number
output = (new JSON)(&quot;myNum&quot;, 2, false)
'generates {&quot;myNum&quot;: 2}

'array with different datatypes
output = (new JSON)(&quot;anArray&quot;, array(2, &quot;x&quot;, null), true)
'generates &quot;anArray&quot;: [2, &quot;x&quot;, null]
'(note: the last parameter was true, thus no surrounding brackets in the result)
%&gt;
</code></pre></div></div>
<table cellspacing="0" id="info_11" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>1.5.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz (gabru at grafix.at), Michael Rebec on 2007-04-26 12:46</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:45:55 PM</td>
</tr>
</table>
<h2><span onclick="togg('props_11')" style="cursor:pointer">Properties</span> <a href="#class_11" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_11" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">recordsetPaging</td>
<td class="type"><span class="type">bool</span></td>
<td>Indicates if only the current page should be processed on paged recordsets.
e.g. would return only 10 records if <em>RS.pagesize</em> is set to 10. default = false (means that always all records are processed)&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">toResponse</td>
<td class="type"><span class="type">bool</span></td>
<td>Should the generated representation be written directly to the response (using <em>response.write</em>)? default = false&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_11')" style="cursor:pointer">Methods</span> <a href="#class_11" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_11" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDATSMMN" onclick="togg('mdetails_11IDATSMMN')" style="font-weight:bold;" title="This is a static method">escape
										(val)
									</a></div>
<div class="mDesc">takes a given string and makes it JSON valid</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_11IDATSMMN">all characters which needs to be escaped are beeing replaced by their
unicode representation according to the
RFC4627#2.5 - http://www.ietf.org/rfc/rfc4627.txt?number=4627<br><br><div class="param"><span class="paramName"> val</span><span>
														[<span class="type">string</span>]</span><br>value which should be escaped</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>JSON valid string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDATTMMN" onclick="togg('mdetails_11IDATTMMN')" class="default">toJSON
										(name, val, nested)
									</a></div>
<div class="mDesc">generates a representation of a name value pair in JSON grammer</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_11IDATTMMN">It generates a name value pair which is represented as <em>{"name": value}</em> in JSON.
the generation is fully recursive. Thus the value can also be a complex datatype (array in dictionary, etc.) e.g.
<div class="code"><pre><code>
&lt;%
set j = new JSON
j.toJSON &quot;n&quot;, array(RS, dict, false), false
j.toJSON &quot;n&quot;, array(array(), 2, true), false
%&gt;
</code></pre></div><br><br><div class="param"><span class="paramName"> name</span><span>
														[<span class="type">string</span>]</span><br>name of the value (accessible with javascript afterwards). leave empty to get just the value</div>
<div class="param"><span class="paramName"> val</span><span>
														[<span class="type">variant</span>, <span class="type">int</span>, <span class="type">float</span>, <span class="type">array</span>, <span class="type">object</span>, <a class="type" href="http://www.w3schools.com/asp/asp_ref_dictionary.asp" target="_blank">dictionary</a>, <a class="type" href="http://www.w3schools.com/ado/ado_ref_recordset.asp" target="_blank">recordset</a>]</span><br>value which needs
to be generated. Conversation of the data types is as follows:<br>
<li class="list"><strong>ASP datatype -> JavaScript datatype</strong></li>
<li class="list"><em>nothing</em>, <em>null</em> -> null</li>
<li class="list"><em>int</em>, <em>double</em> -> number</li>
<li class="list"><em>string</em> -> string</li>
<li class="list"><em>boolean</em> -> bool</li>
<li class="list"><em>array</em> -> array</li>
<li class="list"><em>dictionary</em> -> Represents it as name value pairs. Each key is accessible as property afterwards. json will look like<div class="code"><pre><code>&quot;name&quot;: {&quot;key1&quot;: &quot;some value&quot;, &quot;key2&quot;: &quot;other value&quot;}</code></pre></div></li>
<li class="list"><em>multidimensional array</em> -> Generates a 1-dimensional array (flat) with all values of the multidimensional array</li>
<li class="list"><em>recordset</em> -> array where each row of the recordset represents a field of the array. Each array field has properties according to the column names of the recordset (<strong>lowercase!</strong>) e.g <em>toJSON("r", RS, false)</em> can be accessed afterwards with <em>r[0].id</em></li>
<li class="list"><em>request</em> object -> every property and collection (cookies, form, querystring, etc) of the asp request object is exposed as an item of a dictionary. Property names are <strong>lowercase</strong>. e.g. <em>servervariables</em>.</li>
<li class="list"><em>object</em> -> name of the type (if unknown type) or all its properties (if class implements <em>reflect()</em> method)</li>
Implement a <strong>reflect()</strong> function if you want your custom classes to be recognized. The function must return
a dictionary where the key holds the property name and the value its value. Example of a reflect function within a User class which has firstname and lastname properties
<div class="code"><pre><code>
&lt;%
function reflect()
    set reflect = server.createObject(&quot;scripting.dictionary&quot;)
    reflect.add &quot;firstname&quot;, firstname
    reflect.add &quot;lastname&quot;, lastname
end function
%&gt;
</code></pre></div>
Example of how to generate a JSON representation of the asp request object and access the <em>HTTP_HOST</em> server variable in JavaScript:
<div class="code"><pre><code>
&lt;script&gt;alert(&lt;%= (new JSON)(empty, request, false) %&gt;.servervariables.HTTP_HOST);&lt;/script&gt;
</code></pre></div></div>
<div class="param"><span class="paramName"> nested</span><span>
														[<span class="type">bool</span>]</span><br>indicates if the name value pair is already nested within another? if yes then the <em>{}</em> are left out.</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>returns a JSON representation of the given name value pair
(if toResponse is on then the return is written directly to the response and nothing is returned)</div>
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_12"></a><fieldset class="class">
<legend>
						Class Library <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">This class holds all general methods used within the library. They are accessible
through an already existing instance called <em>lib</em>. It represents the Ajaxed Library itself somehow ;)
Thats why e.g. its possible to get the current version of the library using <em>lib.version</em>
<li class="list">environment specific configs are loaded when an instance of Library is created (thus its possible to override configs dependent on the environment). just place a sub called <em>envDEV</em> to override configs for the <em>dev</em> environment. <em>envLIVE</em> for the <em>live</em>. Note: The config var must be defined outside the sub in order to work:</li>
<div class="code"><pre><code>
&lt;%
'by default we disable the logging
AJAXED_LOGLEVEL = 0
sub envDEV()
    'but we enable it on the dev environment
    AJAXED_LOGLEVEL = 1
end sub
%&gt;
</code></pre></div></div>
<table cellspacing="0" id="info_12" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>1.0</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz - gabru at grafix.at on 12.09.2003</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:19 PM</td>
</tr>
<tr>
<td class="label">Staticname:</td>
<td><em>lib</em></td>
</tr>
</table>
<h2><span onclick="togg('props_12')" style="cursor:pointer">Properties</span> <a href="#class_12" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_12" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">browser</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the browser (uppercased shortcut) which is used. version is ignored. e.g. FF, IE, etc. empty if unknown&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">dev</td>
<td class="type"><span class="type">bool</span></td>
<td>GET:  indicates if the environment is the development env&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">env</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the current environment. <em>LIVE</em> or <em>DEV</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">fso</td>
<td class="type"><span class="type">FileSystemObject</span></td>
<td>holds a filesystemobject instance for global use&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">live</td>
<td class="type"><span class="type">bool</span></td>
<td>GET:  indicates if the environment is the live env (production)&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">logger</td>
<td class="type"><a class="type" href="#class_14">Logger</a></td>
<td>holds a logger instance which is ready-to-use for logging.&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">page</td>
<td class="type"><a class="type" href="#class_1">AjaxedPage</a></td>
<td>holds the current executing page. Nothing if there is not page&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">version</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the version of the whole library&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_12')" style="cursor:pointer">Methods</span> <a href="#class_12" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_12" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDAP2MMN" onclick="togg('mdetails_12IDAP2MMN')">arrayize
										(value)
									</a></div>
<div class="mDesc">Ensures that a given value will be returned as an <em>array</em>.<div class="alias">alias: <em>[](value)</em></div>
</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDAP2MMN">If the <em>value</em> is already
an <em>array</em> then its just passed through otherwise an <em>array</em> is created and the first field contains the <em>value</em>.
Unless: If the <em>value</em> is <em>empty</em> then an empty <em>array</em> is returned.
<div class="code"><pre><code>
&lt;%
'the same as array(&quot;x&quot;)
arr = lib.arrayize(&quot;x&quot;)
'the same as array(&quot;x&quot;, &quot;y&quot;)
arr = lib.arrayize(array(&quot;x&quot;, &quot;y&quot;))
'or use the shortcut alias
arr = [](array(1, 2, 3))
%&gt;
</code></pre></div><br><br><div class="param"><span class="paramName"> value</span><span>
														[<span class="type">variant</span>]</span><br>The value which should be ensured to be an <em>array</em></div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">array</span>]
											<br>Resulting <em>array</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA2DNMN" onclick="togg('mdetails_12IDA2DNMN')">contains
										(data, val)
									</a></div>
<div class="mDesc"><span class="obsolete">This method is obsolete.</span>Checks if a given datastructure contains a given value. Use <em>DataContainer.contains()</em> instead.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDA2DNMN">returns <em>false</em> if the datastructure cannot be determined<br><br><div class="param"><span class="paramName">byRef data</span><span>
														[<span class="type">array</span>, <a class="type" href="http://www.w3schools.com/asp/asp_ref_dictionary.asp" target="_blank">dictionary</a>]</span><br>the data structure which should be checked against.
if its a dictionary then the key is used for comparison.</div>
<div class="param"><span class="paramName">byVal val</span><br></div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br>true if it contains the value</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA4CNMN" onclick="togg('mdetails_12IDA4CNMN')">detectComponent
										(components)
									</a></div>
<div class="mDesc">Detects the first loadable server component from a given list.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDA4CNMN">
<div class="param"><span class="paramName"> components</span><span>
														[<span class="type">array</span>]</span><br>names of the components you want to try to detect</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>name of the component which could be loaded first or <em>empty</em> if no one could be loaded</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAJLNMN" onclick="togg('mdetails_12IDAJLNMN')">error
										(msg)
									</a></div>
<div class="mDesc">writes an error and ends the response. for unexpected errors</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDAJLNMN">this error should be used for any unexpected errors. In comparison to <em>throwError</em>
it should only be used if a common error message should be displayed to the user instead of
raising a real ASP error (<em>throwError</em>).
<li class="list">if buffering is turned off then the already written response won't be cleared.</li>
<li class="list">error is logged into the log</li><br><br><div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>]</span><br>error message</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAEHNMN" onclick="togg('mdetails_12IDAEHNMN')">exec
										(functionName, params)
									</a></div>
<div class="mDesc">calls a given function/sub if it exists</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDAEHNMN">tries to call a given function/sub with the given parameters.
the scope is the scope where exec is called.<br><br><div class="param"><span class="paramName"> functionName</span><br></div>
<div class="param"><span class="paramName"> params</span><span>
														[<span class="type">variant</span>]</span><br>you choose how you provide your params. provide <em>empty</em> to call a procedure without parameters</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">variant</span>]
											<br>whatever the function returns</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAPINMN" onclick="togg('mdetails_12IDAPINMN')">getFunction
										(functionName)
									</a></div>
<div class="mDesc">gets a reference to a function/sub by a given name.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDAPINMN">if function was found it can be executed afterwards. e.g.
<div class="code"><pre><code>&lt;% set f = getFunction(&quot;test&quot;) : f %&gt;</code></pre></div><br><br><div class="param"><span class="paramName"> functionName</span><br></div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">object</span>]
											<br>reference to the function/sub or nothing if not found</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAHMNMN" onclick="togg('mdetails_12IDAHMNMN')">getGUID
										()
									</a></div>
<div class="mDesc">gets a new globally unique Identifier.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDAHMNMN">
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>new guid without hyphens. (hexa-decimal)</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDABPNMN" onclick="togg('mdetails_12IDABPNMN')">getUniqueID
										()
									</a></div>
<div class="mDesc">Returns an unique ID for each pagerequest, starting with 1</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDABPNMN">It is not assured that the returned id is always the same. But it is assured that it is unique on the current page request.<br><br><div class="return"><span class="returnName">Returns </span>
											[<span class="type">int</span>]
											<br>uniqueID : the unique id</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAUQNMN" onclick="togg('mdetails_12IDAUQNMN')">iif
										(condition, expression1, expression2)
									</a></div>
<div class="mDesc">This will replace the <em>IIf</em> function that is missing from the intrinsic functions of VBScript</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDAUQNMN">Makes code more readable by placing a conditional in one line:
<div class="code"><pre><code>&lt;% cssClass = lib.iif(i mod 2 = 0, &quot;even&quot;, &quot;odd&quot;) %&gt;</code></pre></div><br><br><div class="param"><span class="paramName"> condition</span><span>
														[<span class="type">variant</span>]</span><br>condition (must return <em>true</em> or <em>false</em>)</div>
<div class="param"><span class="paramName"> expression1</span><span>
														[<span class="type">variant</span>]</span><br>expression which is returned if the condition is <em>true</em></div>
<div class="param"><span class="paramName"> expression2</span><span>
														[<span class="type">variant</span>]</span><br>expression which is returned if the condition is <em>false</em></div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>returns <em>expression1</em> if <em>condition</em> is <em>true</em> otherwise <em>expression2</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAZMNMN" onclick="togg('mdetails_12IDAZMNMN')">init
										(var, default)
									</a></div>
<div class="mDesc">initializes a variable with a default value if the variable is not set set (<em>isEmpty</em>)</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDAZMNMN">
<div class="param"><span class="paramName"> var</span><span>
														[<span class="type">variant</span>]</span><br>some variable</div>
<div class="param"><span class="paramName"> default</span><span>
														[<span class="type">variant</span>]</span><br>the default value which should be taken if the var is not set (if it is <em>empty</em>)</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">variant</span>]
											<br>if var is set then the var otherwise the default value.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDALJNMN" onclick="togg('mdetails_12IDALJNMN')">newDict
										(values)
									</a></div>
<div class="mDesc">Gets a new dictionary filled with a list of values<div class="alias">alias: <em>["D"](values)</em></div>
</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDALJNMN">
<div class="param"><span class="paramName"> values</span><span>
														[<span class="type">array</span>]</span><br>values to fill into the dictionary. <em>array( array(key, value), arrray(key, value) )</em>.
if the fields are not arrays (name value pairs) then the key is generated automatically. if no array
provided then an empty dictionary is returned</div>
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="http://www.w3schools.com/asp/asp_ref_dictionary.asp" target="_blank">dictionary</a>]
											<br>dictionary with values.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAKSNMN" onclick="togg('mdetails_12IDAKSNMN')">newRecordset
										(records)
									</a></div>
<div class="mDesc">Creates a new disconnected recordset with a given set of records.<div class="alias">alias: <em>["R"](records)</em></div>
</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDAKSNMN">Some details about the created recordset:
<li class="list">Position is before the first record and therefore ready for traversing.</li>
<li class="list">It is a disconnected recordset (no database required)</li>
<div class="code"><pre><code>
&lt;%
set users = lib.newRecordset(array( _
    array(&quot;firstname&quot;, &quot;lastname&quot;, &quot;createdOn&quot;), _
    array(&quot;John&quot;, &quot;Doe&quot;, now()), _
    array(&quot;Tomy&quot;, &quot;Foo&quot;, now()) _
))

'this produces a recordset with columns
'&quot;firstname&quot;, &quot;lastname&quot; and &quot;createdON&quot;
'Additionally it contains already two records.
'and is ready for traversing:
while not user.eof
    lib.logger.debug user(&quot;firstname&quot;)
    users.movenext()
wend

'Note: set users = lib.newRecordset(...)
'is the same as set users = [&quot;R&quot;](...)
%&gt;
</code></pre></div><br><br><div class="param"><span class="paramName"> records</span><span>
														[<span class="type">array</span>]</span><br>An array with records.
<li class="list">each field of the array represents a record (represented as an array as well) of the recordset.</li>
<li class="list">the first record holds the field names (columns of the recordset) and therefore is not a "real record".</li></div>
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="http://www.w3schools.com/ado/ado_ref_recordset.asp" target="_blank">recordset</a>]
											<br>always returns a <em>recordset</em> with the position of BOF.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAP0MMN" onclick="togg('mdetails_12IDAP0MMN')">options
										(optionNames, actualOptions, defaultValues)
									</a></div>
<div class="mDesc">Creates an <em>optionshash</em> out of an <em>array</em>.<div class="alias">alias: <em>["O"](optionNames, actualOptions, defaultValues)</em></div>
</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDAP0MMN"><em>optionshash</em> is the term for a hash with name value pairs. Its main idea is to simulate optional parameters
for VBScript methods and transform an <em>array</em> into an associative <em>array</em> (collection of unique keys and a collection of values, where each key is associated with one value).
With this its possible to extend a methods input without changing the methods signature.
The <em>optionshash</em> is represented with a <em>dictionary</em> (The idea of options has been taken from Ruby on Rails as those guys
also often use a hash as the last argument of a function. And it works great ;)). Example of usage:
<div class="code"><pre><code>
&lt;%
'a function which accepts options
function doSomething(options)
    lib.options array(&quot;a&quot;, &quot;b&quot;), options, 0
    'or you can also use the alias
    [&quot;O&quot;] array(&quot;a&quot;, &quot;b&quot;), options, 0
    'now the variable options has been transformed into an optionshash...
    str.write(options(&quot;a&quot;))
    str.write(options(&quot;b&quot;))
end function

'now calling the function in various ways..
doSomething(array(&quot;a&quot;, 1, &quot;b&quot;, 2))
'prints: 12
doSomething(array(&quot;b&quot;, &quot;cool&quot;))
'prints: cool
doSomething(empty)
'prints: 00
%&gt;
</code></pre></div>
Assurances for an <em>optionshash</em>:
<li class="list">Keys of the <em>dictionary</em> represent the option names and items represent the option values. One option name incl its corresponding value is called <em>option</em>.</li>
<li class="list">Each <em>optionshash</em> can contain <em>1-n</em> options</li>
<li class="list">Each <em>optionshash</em> is always an instance of a <em>dictionary</em> and is never <em>nothing</em>.</li>
<li class="list">Option names are always <strong>lowercased</strong> strings and contain at least one character.</li>
<li class="list">The order of options within an <em>optionshash</em> is arbitrary.</li><br><br><div class="param"><span class="paramName">byVal optionNames</span><span>
														[<span class="type">array</span>, <span class="type">string</span>]</span><br>Name(s) of the options which are part of the <em>optionshash</em>.</div>
<div class="param"><span class="paramName">byRef actualOptions</span><span>
														[<span class="type">array</span>]</span><br>Contains the options which will be converted into an <em>optionshash</em>. It must be an <em>array</em> with an even amount of fields or <em>empty</em> (if no options).
Each odd field represents the name of the options and each even field its value. Example:
<div class="code"><pre><code>
&lt;%
'valid options
array(&quot;option1&quot;, &quot;value1&quot;, &quot;option2&quot;, &quot;value2&quot;)
array(&quot;option1&quot;, empty)
array()
'invalid options
array(&quot;option1&quot;, &quot;value1&quot;, &quot;option2&quot;)
%&gt;
</code></pre></div>
<strong>Important:</strong> This variable is an <em>optionshash</em> (<em>dictionary</em>) afterwards!</div>
<div class="param"><span class="paramName">byVal defaultValues</span><span>
														[<span class="type">variant</span>, <span class="type">array</span>]</span><br>The default value(s) for each option which does not exist within the <em>options</em>. Usually <em>empty</em>.
Its possible to provide an <em>array</em> and give each option a different default value. If there are more options then default values then the last
defaut value is used. Example with more default values:
<div class="code"><pre><code>
&lt;%
[&quot;O&quot;] array(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;), empty, array(1, 0)
'=&gt; a=1, b=0, c=0
[&quot;O&quot;] array(&quot;a&quot;, &quot;b&quot;, &quot;c&quot;), empty, array(1, 2, 3)
'=&gt; a=1, b=2, c=3
%&gt;
</code></pre></div></div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">optionshash</span>]
											<br>Also returns the generated <em>optionshash</em>. See the method details for the definition of an <em>optionshash</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAWANMN" onclick="togg('mdetails_12IDAWANMN')">path
										(filename)
									</a></div>
<div class="mDesc">gets the virtual path of the ajaxed library root folder.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDAWANMN">useful for static files like e.g. javascript, css which are used internally by the library<br><br><div class="param"><span class="paramName"> filename</span><span>
														[<span class="type">string</span>]</span><br>some file which should be appended to the root path. e.g. <em>class_rss/rss.asp</em> would return <em>/ajaxed/class_rss/rss.asp</em> leave <em>empty</em> if not required</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>path of ajaxed root folder. e.g. <em>/ajaxed/</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAFZMMN" onclick="togg('mdetails_12IDAFZMMN')">random
										(min, max)
									</a></div>
<div class="mDesc">Returns a random number within a given range</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDAFZMMN">
<div class="param"><span class="paramName"> min</span><span>
														[<span class="type">int</span>]</span><br>The minimum possible number (inclusive)</div>
<div class="param"><span class="paramName"> max</span><span>
														[<span class="type">int</span>]</span><br>The maximum possible number (inclusive)</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">int</span>]
											<br>Number within the desired range</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAMFNMN" onclick="togg('mdetails_12IDAMFNMN')">range
										(startsWith, endsWith, interval)
									</a></div>
<div class="mDesc">generates an array for a range of values which are defined by its start and end.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDAMFNMN">
<div class="param"><span class="paramName"> startsWith</span><br></div>
<div class="param"><span class="paramName"> endsWith</span><span>
														[<span class="type">float</span>, <span class="type">int</span>]</span><br>the end of the range (incl)</div>
<div class="param"><span class="paramName"> interval</span><span>
														[<span class="type">float</span>, <span class="type">int</span>]</span><br>the step for the incremental increase of the starting value</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">array</span>]
											<br>array with numbers where each value is a value between the boundaries (incl)</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAN3MMN" onclick="togg('mdetails_12IDAN3MMN')">requestURL
										(method, url, params, options)
									</a></div>
<div class="mDesc">Requests an URL and returns an <em>IXMLDOMDocument</em>.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDAN3MMN">Post parameters are always encoded with UTF-8.<br><br><div class="param"><span class="paramName"> method</span><span>
														[<span class="type">string</span>]</span><br><em>GET</em> or <em>POST</em></div>
<div class="param"><span class="paramName"> url</span><span>
														[<span class="type">int</span>]</span><br>URL for the request. Only full URLs are supported (starting with <em>http://</em>, <em>https://</em>, etc.)
or virtual URLs (starting with <em>/</em>) to request internal pages</div>
<div class="param"><span class="paramName"> params</span><span>
														[<span class="type">array</span>, <span class="type">string</span>]</span><br>Parameters for the request. Even fields of the array hold the names and the odd fields hold the corresponding values.
Values are automatically <em>urlEncoded</em>.
<li class="list">if <em>POST</em> request then send as <em>POST</em> values (if querystring values needed then add them direclty to the URL).</li>
<li class="list">if <em>GET</em> request then send via querystring.</li>
<li class="list">provide <em>empty</em> if no parameters are needed</li>
<li class="list">if the value is a <em>string</em> then its just passed through to POST (as post variables) or GET (as querystring) request</li></div>
<div class="param"><span class="paramName"> options</span><br></div>
<div class="param"><span class="paramName"> option "requestheader"</span><span>
														[<span class="type">array</span>]</span><br>some additional request header which should be passed to the request. It must be an array where each even value represents the name and the odd values represent the value of the header.
e.g. array("Accept-Language", "en")</div>
<div class="param"><span class="paramName"> option "implementation"</span><span>
														[<span class="type">string</span>]</span><br>Define a desired <em>IServerXMLHTTPRequest</em>. Default: <em>Msxml2.ServerXMLHTTP.3.0</em></div>
<div class="param"><span class="paramName"> option "timeout"</span><span>
														[<span class="type">int</span>]</span><br>Timeout in seconds for the request. <em>0</em> means unlimited (not recommended!). Default is <em>3</em></div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">IServerXMLHTTPRequest</span>]
											<br>Returns an object which implements <em>IServerXMLHTTPRequest</em>.
<li class="list">It returns <em>nothing</em> if the page could not be requested at all (timout & network errors)</li>
<li class="list"> You can check if request was successful by checking the <em>status</em> property (<em>200</em> means succesful).</li>
<li class="list">If you need xml then use the <em>responseXML</em> property. Be sure to check if <em>responseXML.parseError.errorCode</em> is <em>0</em> before you proceed using xml.</li>
<li class="list">Check your logfile to see more details for debugging</li>
<li class="list">Check http://msdn.microsoft.com/en-us/library/ms754586(VS.85).aspx for more members of <em>IServerXMLHTTPRequest</em></li></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAUBNMN" onclick="togg('mdetails_12IDAUBNMN')">require
										(classname, caller)
									</a></div>
<div class="mDesc">Requires a given class to be existing. error is raised if it does not exist</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDAUBNMN">
<div class="param"><span class="paramName"> classname</span><span>
														[<span class="type">string</span>]</span><br>name of the class you want to be required</div>
<div class="param"><span class="paramName"> caller</span><span>
														[<span class="type">string</span>]</span><br>name of the object requiring the class</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDADONMN" onclick="togg('mdetails_12IDADONMN')">sleep
										(seconds)
									</a></div>
<div class="mDesc">Sleeps for a specified time. for a while :)</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDADONMN">
<div class="param"><span class="paramName"> seconds</span><span>
														[<span class="type">int</span>]</span><br>how many seconds. Minmum 1, Maximum 20. Value will be autochanged if value
is incorrect.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAJKNMN" onclick="togg('mdetails_12IDAJKNMN')">throwError
										(args)
									</a></div>
<div class="mDesc">throws an ASP runtime Error which can be handled with on error resume next</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDAJKNMN">if you want to throw an error where just the user should be notified use <em>lib.error</em> instead<br><br><div class="param"><span class="paramName"> args</span><span>
														[<span class="type">array</span>, <span class="type">string</span>]</span><br>
<li class="list">if <em>array</em> then fields => number, source, description</li>
<li class="list">The number range for user errors is 512 (exclusive) - 1024 (exclusive)</li>
<li class="list">if <em>args</em> is a string then its handled as the description and an error is raised with the</li>
<li class="list">Error is logged into the logger</li>
number 1024 (highest possible number for user defined VBScript errors)</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDATPNMN" onclick="togg('mdetails_12IDATPNMN')">URLDecode
										(endcodedText)
									</a></div>
<div class="mDesc">Opposite of <em>server.URLEncode</em></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_12IDATPNMN">If you store a variable in the queryString then the variables input will be automatically
encoded. Sometimes you need a function to decode this <em>%20%2H</em>, etc.<br><br><div class="param"><span class="paramName"> endcodedText</span><span>
														[<span class="type">string</span>]</span><br>your string which should be decoded. e.g: <em>Haxn%20Text</em> (%20 = Space)</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>decoded string</div>
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_13"></a><fieldset class="class">
<legend>
						Class Localization <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Contains all stuff which has to do with Localization.
"Localization is the configuration that allows a program to be adaptable to local national-language features."
Also stuff about the client can be found in this class e.g. clients IP address (often needed to localize the user)</div>
<table cellspacing="0" id="info_13" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>michal on 2008-07-16 11:18</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:20 PM</td>
</tr>
<tr>
<td class="label">Staticname:</td>
<td><em>local</em></td>
</tr>
</table>
<h2><span onclick="togg('props_13')" style="cursor:pointer">Properties</span> <a href="#class_13" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_13" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">comma</td>
<td class="type"><span class="type">char</span></td>
<td>GET:  Gets the char which represents the comma when using floating numbers. Returns either "," or "."&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">IP</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the clients IP address (can also be the clients ISP IP).&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_13')" style="cursor:pointer">Methods</span> <a href="#class_13" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_13" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDA2UNMN" onclick="togg('mdetails_13IDA2UNMN')">locateClient
										(timeout, clientIP)
									</a></div>
<div class="mDesc">Locates the country of a given clients IP address.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_13IDA2UNMN">Currently Information is gathered from the free service at http://www.hostip.info and the clients IP is
taken from the <em>serverVariables</em>. Note: As the location is the ISPs location its not sure that the
client is located in the same location.
<li class="list">The location is cached within the users session. Therefore only the first call will access the service (unless its a failure).</li>
<li class="list">Hint: For debuging you can check the logfile to see all the communication details with the service.</li>
Example of a correct call:
<div class="code"><pre><code>
&lt;%
countryCode = local.locateClient(2, empty)
if isEmpty(countryCode) then str.writeEnd(&quot;Service unavailable&quot;)
if countryCode = &quot;XX&quot; then str.writeEnd(&quot;Location unknown&quot;)
'if location was found then the country is available for sure
str.writef(&quot;You are located in '{0}', arent you?&quot;, countryCode)
%&gt;
</code></pre></div><br><br><div class="param"><span class="paramName"> timeout</span><span>
														[<span class="type">int</span>]</span><br>Timeout for the request in seconds. <em>0</em> mean as long as possible (not recommended!)</div>
<div class="param"><span class="paramName"> clientIP</span><span>
														[<span class="type">string</span>]</span><br>The IP you want to check. Provide <em>empty</em> to check the clients IP (<em>Localization.IP</em>). Only if <em>empty</em> is given then the query will be temporary cached in the session.</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>
<li class="list">Returns the 2 letters upper-cased country code (if could determine) as given in ISO 3166-1.</li>
<li class="list">Returns <em>XX</em> if the location is unknown (service is available but could not determine location). Also if the IP is private.</li>
<li class="list">Returns <em>empty</em> on a failure (xml parsing errors & network errors e.g. timeout, service down, etc.)</li></div>
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_14"></a><fieldset class="class">
<legend>
						Class Logger <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Provides the opportunity to log messages into text files. Logging can be done on different levels:
<li class="list"><em>1</em> (debug): all kind of debugging messages</li>
<li class="list"><em>2</em> (info): messages which should inform the developer about something. e.g. Progress of a procedure</li>
<li class="list"><em>4</em> (warn): messages which warn the developer. e.g. a method is obsolete</li>
<li class="list"><em>8</em> (error): messages which contain an error</li>
Which messages are actually logged can be set with the <em>logLevel</em> property directly or in the config with <em>AJAXED_LOGLEVEL</em>.
Simple logging within ajaxed:
<div class="code"><pre><code>
&lt;%
lib.logger.debug(&quot;some debug message&quot;)
lib.logger.warn(&quot;a warning like e.g. use method A instead of B&quot;)
lib.logger.info(&quot;user logged in&quot;)
lib.logger.error(&quot;some error happend&quot;)
%&gt;
</code></pre></div>
<li class="list">Logging is disabled by default</li>
<li class="list">Logger supports ascii coloring => log files are easier to read. </li>
<li class="list">Its recommended to download e.g. "cygwin" and hook up the log file with <em>"tail -f file.log"</em>. This allows you to immediately follow the log and it supports coloring as well.</li>
<li class="list">Its also possible to view the changes log files directly in the ajaxed console</li>
<li class="list">Logfiles are named after the environment. <em>dev.log</em> and <em>live.log</em></li>
<li class="list">Within the ajaxed library <em>lib.logger</em> holds an instance of a ready-to-use logger</li>
<li class="list">Some useful debug messages are already automatically logged within the ajaxed library. e.g. SQL queries, page requestes, ajaxed callbacks, emails, ...</li>
<li class="list">Log files can also be found in the ajaxed console.</li>
<li class="list">It might be necessary that the logs path has write permission for the IIS user</li>
<li class="list">All non-ascii chars (<em>\u0100-\uFFFF</em>) will be converted to its hex notation (e.g. <em>\uF9F9</em>) as most shells cannot display unicode</li></div>
<table cellspacing="0" id="info_14" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>1.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz on 28.04.2008</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:22 PM</td>
</tr>
</table>
<h2><span onclick="togg('props_14')" style="cursor:pointer">Properties</span> <a href="#class_14" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_14" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">colorize</td>
<td class="type"><span class="type">bool</span></td>
<td>should the logs be colorized. Only useful if you have a shell which supports ASCII colorization. default = <em>true</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">defaultStyle</td>
<td class="type"><span class="type">string</span></td>
<td>the default appearance of log messages. check doc in <em>log()</em> method. leave empty if you dont want to use styles at all. This will keep your file clean if you prefer to read them with a common text editor&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">logfile</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the full path and name of the logfile&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">logLevel</td>
<td class="type"><span class="type">int</span></td>
<td>indicates the logger level. disabled = <em>0</em>, debug = <em>1</em>, info = <em>2</em>, warn = <em>4</em>, error = <em>8</em>
<li class="list">all messages with a number than the <em>loglevel</em> will be logged as well. Lower numbers wont! So e.g. setting level to <em>2</em> (info) will log info-, warn-, and error messages</li>
<li class="list">by default it is set to <em>0</em> (disabled)</li>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">msgPrefix</td>
<td class="type"><span class="type">string</span></td>
<td>the prefix for all log messages. by default its the users ip and time stamp followed by a tabulator&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">path</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  gets the virtual path where the logfiles are located. e.g. <em>/ajaxedLogs/</em>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">prefix</td>
<td class="type"><span class="type">string</span></td>
<td>SET:  sets the prefix for the log file. Useful if you have more applications and want to have the logs separated. e.g. your app is named <em>"app1"</em> then it will result in a logfile <em>app1_dev.log</em> on the <em>dev</em> env. default = EMPTY&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_14')" style="cursor:pointer">Methods</span> <a href="#class_14" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_14" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDAWBOMN">clearLogs
										()
									</a></div>
<div class="mDesc">Deletes all logfiles</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_14IDAWBOMN">
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAT3NMN" onclick="togg('mdetails_14IDAT3NMN')">debug
										(msg)
									</a></div>
<div class="mDesc">helper to log a message as a debug message</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_14IDAT3NMN">
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>, <span class="type">array</span>]</span><br>message(s) to debug. (if <em>array</em> then treated as lines)</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAT4NMN" onclick="togg('mdetails_14IDAT4NMN')">error
										(msg)
									</a></div>
<div class="mDesc">helper to log a message as an error.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_14IDAT4NMN">
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>, <span class="type">array</span>]</span><br>message(s) to log</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAWAOMN" onclick="togg('mdetails_14IDAWAOMN')">info
										(msg)
									</a></div>
<div class="mDesc">helper to log a message as an information</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_14IDAWAOMN">
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>, <span class="type">array</span>]</span><br>message(s) to log</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAZ0NMN" onclick="togg('mdetails_14IDAZ0NMN')">log
										(level, msg, style)
									</a></div>
<div class="mDesc">logs a message</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_14IDAZ0NMN">
<div class="param"><span class="paramName"> level</span><span>
														[<span class="type">int</span>]</span><br>level of logging. possible: <em>0</em> (disabled), <em>1</em> (debug), <em>2</em> (info), <em>4</em> (warn), <em>8</em> (error)
<li class="list">its depending on the loggerLevel setting which level will be logged</li></div>
<div class="param"><span class="paramName">byVal msg</span><span>
														[<span class="type">string</span>, <span class="type">array</span>]</span><br>the message you want to log. if <em>array</em> then each field is treated as a line but only the first one has the message prefix</div>
<div class="param"><span class="paramName">byVal style</span><span>
														[<span class="type">string</span>]</span><br>ansi style and color code. check details at http://en.wikipedia.org/wiki/ANSI_escape_code
some values: 31 red, 32 green, 33 yellow, 34 blue, 35 magenta, 36 cyan, 37 white
41 red BG, 42, green BG, ....</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAV2NMN" onclick="togg('mdetails_14IDAV2NMN')">logsOnLevel
										(level)
									</a></div>
<div class="mDesc">indicates if a given level would be logged by the logger or not</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_14IDAV2NMN">useful if your log message uses some resources which could be saved if the desired loglevel isnt even supported<br><br><div class="param"><span class="paramName"> level</span><span>
														[<span class="type">int</span>]</span><br>the level which should be checked.</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br>true if it would be logged, otherwise false</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAT5NMN" onclick="togg('mdetails_14IDAT5NMN')">warn
										(msg)
									</a></div>
<div class="mDesc">helper to log a message as a warning</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_14IDAT5NMN">
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>, <span class="type">array</span>]</span><br>message(s) to log</div>
</div>
</td>
</tr>
</table>
<h2><span onclick="togg('inits_14')" style="cursor:pointer">Initializations</span> <a href="#class_14" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="inits_14" class="table alwaysPrint" style="display:none; border: 1px solid #888888" cellpadding="3" cellspacing="0" border="0">
<tr>
<th>Config var.</th>
<th>Property</th>
<th>Default</th>
</tr>
<tr style="background-color:#EEEEEE">
<td>
<div class="iConstant">AJAXED_LOG_COLORIZE</div>
</td>
<td>
<div class="iProperty">colorize</div>
</td>
<td>
<div class="iDefault">true</div>
</td>
</tr>
<tr>
<td>
<div class="iConstant">AJAXED_LOGSTYLE</div>
</td>
<td>
<div class="iProperty">defaultStyle</div>
</td>
<td>
<div class="iDefault">"0;37"</div>
</td>
</tr>
<tr style="background-color:#EEEEEE">
<td>
<div class="iConstant">AJAXED_LOGLEVEL</div>
</td>
<td>
<div class="iProperty">logLevel</div>
</td>
<td>
<div class="iDefault">-1</div>
</td>
</tr>
<tr>
<td>
<div class="iConstant">AJAXED_LOGMSG_PREFIX</div>
</td>
<td>
<div class="iProperty">msgPrefix</div>
</td>
<td>
<div class="iDefault">request.servervariables("remote_addr") &amp; " " &amp; now() &amp; vbTab</div>
</td>
</tr>
<tr style="background-color:#EEEEEE">
<td>
<div class="iConstant">AJAXED_LOGSPATH</div>
</td>
<td>
<div class="iProperty">p_path</div>
</td>
<td>
<div class="iDefault">"/ajaxedLogs/"</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_15"></a><fieldset class="class">
<legend>
						Class MD5 <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Thats a class for MD5 encryption.
MD5: Derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm,
as set out in the memo RFC1321. One way encryption!
Encryption-code taken from Web Site: http://www.frez.co.uk and modified to a class. Many thanks!</div>
<table cellspacing="0" id="info_15" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz - gabru at grafix.at on 29.12.2007</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:45:57 PM</td>
</tr>
</table>
<h2><span onclick="togg('props_15')" style="cursor:pointer">Properties</span> <a href="#class_15" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_15" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</table>
<h2><span onclick="togg('meths_15')" style="cursor:pointer">Methods</span> <a href="#class_15" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_15" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDAEDOMN" onclick="togg('mdetails_15IDAEDOMN')" class="default">hash
										(val)
									</a></div>
<div class="mDesc">returns a MD5 hash for the given value</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_15IDAEDOMN">
<div class="param"><span class="paramName"> val</span><span>
														[<span class="type">string</span>]</span><br>the string for hashing</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>MD5 hash</div>
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_17"></a><fieldset class="class">
<legend>
						Class RSS <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Reads RSS feeds and gives you the possibility of formating it with xsl or using
the items programmatically as objects. Additionally it lets you generate your own feeds.
<li class="list">READING: achieved with <em>load()</em> or <em>draw()</em>. Refer to the methods for the supported versions</li>
<li class="list">WRITING: achiedved with <em>generate()</em>. Refer to the method for the supported versions</li>
If caching should be enabled use the <em>setCache()</em> method. By default caching is off.
<li class="list">on <em>draw()</em> caching stores the complete transformed output in the cache</li>
<li class="list">on <em>load()</em> caching stores the xml in the cache and parses it out from the cache.</li>
Simple example of how to read an RSS feed:
<div class="code"><pre><code>
&lt;%
set r = new RSS
r.url = &quot;http://somehost.com/somefeed.xml&quot;
r.load()
if r.failed then lib.error(&quot;could not read feed. could be down or wrong format&quot;)
for each it in r.items
    str.write(r.title &amp; &quot;&lt;br&gt;&quot;)
next
%&gt;
</code></pre></div></div>
<table cellspacing="0" id="info_17" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>1.0</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz on 2006-09-08 15:07</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:45:58 PM</td>
</tr>
<tr>
<td class="label">Postfix:</td>
<td>rss</td>
</tr>
<tr>
<td class="label">Requires:</td>
<td><a class="type" href="#class_2">Cache</a></td>
</tr>
</table>
<h2><span onclick="togg('props_17')" style="cursor:pointer">Properties</span> <a href="#class_17" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_17" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">debug</td>
<td class="type"><span class="type">bool</span></td>
<td>turns debuging on/off. if on then useful information will be shown which can be used
if the feed never loads. e.g. the response of the server, etc. default = false&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">description</td>
<td class="type"><span class="type">string</span></td>
<td>description of the feed&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">failed</td>
<td class="type"><span class="type">bool</span></td>
<td>indicates if any of the methods <em>load()</em> or <em>draw()</em>
e.g. server not responding, timeouts, etc.&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">items</td>
<td class="type"><a class="type" href="http://www.w3schools.com/asp/asp_ref_dictionary.asp" target="_blank">dictionary</a></td>
<td>collection of the items (<em>RSSItem</em>). after <em>load()</em> this gets filled
<li class="list">for writing a feed this collection needs to be filled with items which sould be published. Use <em>addItem()</em></li>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">language</td>
<td class="type"><span class="type">string</span></td>
<td>the language of the feed. e.g. <em>en</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">link</td>
<td class="type"><span class="type">string</span></td>
<td>link which is associated with the feed&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">publishedDate</td>
<td class="type"><span class="type">date</span></td>
<td>date when the feed has been published. you local timezone!&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">theCache</td>
<td class="type"><a class="type" href="#class_2">Cache</a></td>
<td>holds the cache which is used for caching the feed. by default it is nothing and
should only be set by <em>setCache()</em>. afterwards this property can be used.&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">timeout</td>
<td class="type"><span class="type">int</span></td>
<td>timeout in seconds for the requests. default = 2&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">title</td>
<td class="type"><span class="type">string</span></td>
<td>title of the feed&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">url</td>
<td class="type"><span class="type">string</span></td>
<td>url of the RSS feed (necessary for <em>load()</em> and <em>draw()</em>)&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_17')" style="cursor:pointer">Methods</span> <a href="#class_17" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_17" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDA0IPMN" onclick="togg('mdetails_17IDA0IPMN')">addItem
										(rItem)
									</a></div>
<div class="mDesc">adds an item to the items collection</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_17IDA0IPMN">
<div class="param"><span class="paramName"> rItem</span><span>
														[<a class="type" href="#class_16">RSSItem</a>]</span><br>the item you want to add</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA1EPMN" onclick="togg('mdetails_17IDA1EPMN')">draw
										(xslPath)
									</a></div>
<div class="mDesc">draws the RSS feed with a given XSL. if cached then it will be taken from the cache</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_17IDA1EPMN">The whole HTML is taken from the cache and not just the data. so tranformation
is performed just once.
<li class="list">supported formats: all because the XSL needs to be provided by the client manually</li>
<li class="list">check failed property after execution</li><br><br><div class="param"><span class="paramName"> xslPath</span><span>
														[<span class="type">string</span>]</span><br>virtual path to the xsl. e.g. <em>/xsl/foo.xsl</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDANHPMN" onclick="togg('mdetails_17IDANHPMN')">generate
										(format, target)
									</a></div>
<div class="mDesc">generates a feed with the given items and the metadata (title, etc.). Returns the
generated XMLDOM and provides the possibility to save it into a file immediately</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_17IDANHPMN">Feed is generated with UTF-8 (Note: your file must be saved as UTF-8 in order to support this).
there are two ways to generate the feed:<br><br>
<strong>1.</strong> Using a file which will be stored on your server (by providing a target param)
(normally used if you have an action in your application which invokes the feed
generation. e.g. new post in a blog system)<br><br>
<strong>2.</strong> Getting the XML and using it as desired. e.g. sending to the response (no target param)
(normally used if the feed is generated on each feed request - so the feed is an ASP file
itself and is generated on each request.)<br><br>
Example (2nd approach) of how to create a feed on your site (the example creates the feed everytime a feed reader accesses the page)
which gets the news from a <em>news</em> database table:
<div class="code"><pre><code>
&lt;%
set r = new RSS
r.title = &quot;My new ajaxed feed&quot;
r.description = &quot;important stuff&quot;
r.language = &quot;en&quot;
r.link = &quot;http://mysite.com&quot;

set RS = db.getRS(&quot;SELECT * FROM news ORDER BY published_on DESC LIMIT 10&quot;, empty)
while not RS.eof
    if isEmpty(pubDate) then pubDate = cDate(RS(&quot;published_on&quot;))
    set it = new RSSItem
    it.author = RS(&quot;author&quot;)
    it.description = RS(&quot;excerpt&quot;)
    it.link = &quot;http://mysite.com/news/?&quot; &amp; RS(&quot;id&quot;)
    it.guid = it.link
    it.title = RS(&quot;title&quot;)
    it.publishedDate = cDate(RS(&quot;published_on&quot;))
    r.addItem(it)
    RS.movenext()
wend
if isEmpty(pubDate) then pubDate = now()
r.publishedDate = pubDate
set xml = r.generate(&quot;RSS2.0&quot;, empty)
xml.save(response)
%&gt;
</code></pre></div><br><br><div class="param"><span class="paramName"> format</span><span>
														[<span class="type">string</span>]</span><br>Currently only the option <em>RSS2.0</em> is possible</div>
<div class="param"><span class="paramName"> target</span><span>
														[<span class="type">string</span>]</span><br>path to the file you want to save the feed to. e.g. <em>/feeds/feed.xml</em>
leave <em>empty</em> if you want to get the XML returned</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">microsoft.xmldom</span>]
											<br>the resulted xmldom</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAZFPMN" onclick="togg('mdetails_17IDAZFPMN')">load
										()
									</a></div>
<div class="mDesc">loads the feed. so the items, title, link, etc. will be set</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_17IDAZFPMN">use this if you want to access e.g. the items of the feed and dont want to use
the <em>draw()</em> method using the XSL. Note: using this method wont use the caching!
<li class="list">supported formats: RSS1.0 (RDF), RSS2.0, RSS0.92, RSS0.94 and ATOM</li>
<li class="list">check failed property after execution</li><br><br></div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDALGPMN" onclick="togg('mdetails_17IDALGPMN')" style="font-weight:bold;" title="This is a static method" class="default">loadNew
										(anUrl)
									</a></div>
<div class="mDesc">Creates a new RSS instance and loads it immediately afterwards. Useful for quick reading of a feed</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_17IDALGPMN"><div class="code"><pre><code>
set r = (new RSS)(&quot;http://feed.someurl.com&quot;)
if r.failed then lib.error(&quot;could not get.&quot;)
</code></pre></div><br><br><div class="param"><span class="paramName"> anUrl</span><span>
														[<span class="type">string</span>]</span><br>Url of the feed you want to get</div>
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="#class_17">RSS</a>]
											<br>The RSS feed which has been already loaded</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAYJPMN" onclick="togg('mdetails_17IDAYJPMN')">reflect
										()
									</a></div>
<div class="mDesc">reflection of the properties and its values</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_17IDAYJPMN">
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="http://www.w3schools.com/asp/asp_ref_dictionary.asp" target="_blank">dictionary</a>]
											<br><em>key</em> = property-name, <em>value</em> = property value</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAKKPMN" onclick="togg('mdetails_17IDAKKPMN')">setCache
										(interval, value)
									</a></div>
<div class="mDesc">sets the caching of the RSS. the Cache class needs to be loaded for this</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_17IDAKKPMN">Specify how long the feed should be cashed till it will be requested again. For more
information about the caching look up the <em>Cache</em> class<br><br><div class="param"><span class="paramName"> interval</span><span>
														[<span class="type">string</span>]</span><br><em>m</em> = months, <em>y</em> = year, <em>d</em> = day, etc. everything accepted which is supported by <em>dateadd</em> function</div>
<div class="param"><span class="paramName"> value</span><span>
														[<span class="type">int</span>]</span><br>value for the interval. e.g. 1 (month)</div>
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_16"></a><fieldset class="class">
<legend>
						Class RSSItem <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">used with the RSSReader</div>
<table cellspacing="0" id="info_16" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz on 2006-11-08 18:15</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:45:59 PM</td>
</tr>
<tr>
<td class="label">Friend of:</td>
<td><a class="type" href="#class_17">RSS</a></td>
</tr>
</table>
<h2><span onclick="togg('props_16')" style="cursor:pointer">Properties</span> <a href="#class_16" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_16" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">author</td>
<td class="type"><span class="type">string</span></td>
<td>author of the item&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">category</td>
<td class="type"><span class="type">string</span></td>
<td>name of the category&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">comments</td>
<td class="type"><span class="type">string</span></td>
<td>link to the comments of the item (if available)&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">description</td>
<td class="type"><span class="type">string</span></td>
<td>content&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">GUID</td>
<td class="type"><span class="type">string</span></td>
<td>an unique identifier for the item. usually the same as link&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">link</td>
<td class="type"><span class="type">string</span></td>
<td>link to the item&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">publishedDate</td>
<td class="type"><span class="type">date</span></td>
<td>date when the item has been published. your local timezone.&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">title</td>
<td class="type"><span class="type">string</span></td>
<td>title of the item&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_16')" style="cursor:pointer">Methods</span> <a href="#class_16" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_16" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDAWHOMN" onclick="togg('mdetails_16IDAWHOMN')">reflect
										()
									</a></div>
<div class="mDesc">reflection of the properties and its values</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_16IDAWHOMN">
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="http://www.w3schools.com/asp/asp_ref_dictionary.asp" target="_blank">dictionary</a>]
											<br><em>key</em> = property-name, <em>value</em> = property value</div>
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_18"></a><fieldset class="class">
<legend>
						Class SHA256 <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Thats a class for SHA256 encryption.
Encryption-code taken from Web Site: http://www.frez.co.uk and modified to a class. Many thanks!</div>
<table cellspacing="0" id="info_18" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Original work by Phil Fresle &lt;http://www.frez.co.uk&gt; @ 2001 on 2001</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:00 PM</td>
</tr>
</table>
<h2><span onclick="togg('props_18')" style="cursor:pointer">Properties</span> <a href="#class_18" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_18" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">classType</td>
<td class="type">
</td>
<td>Thats a class for SHA256 encryption.
Encryption-code taken from Web Site: http://www.frez.co.uk and modified to a class. Many thanks!&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">classVersion</td>
<td class="type">
</td>
<td>Thats a class for SHA256 encryption.
Encryption-code taken from Web Site: http://www.frez.co.uk and modified to a class. Many thanks!&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_18')" style="cursor:pointer">Methods</span> <a href="#class_18" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_18" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDAANPMN" onclick="togg('mdetails_18IDAANPMN')">hash
										(sMessage)
									</a></div>
<div class="mDesc"></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_18IDAANPMN">
<div class="param"><span class="paramName"> sMessage</span><br></div>
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_19"></a><fieldset class="class">
<legend>
						Class StringBuilder <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Represents a string builder which handles string concatenation. If a supported stringbuilder
COM component can be found it is used and hence the concatenation is much faster than common string
concatening.
<li class="list">check supported components with the <em>supportedComponents</em> property. </li>
<li class="list">you should use it whereever there is a loads of output to be rendered on your page. Its faster than normal concatening.</li>
<li class="list">basically just intantiate it and use <em>append()</em> method for appending. In the end use <em>toString()</em> to output your string</li>
<li class="list">if there is no component found then it would be faster to directly write the output to the response. This can be achieved using the <em>write()</em> method</li>
Best way to use the <em>StringBuilder</em> (always uses the fastest possible method):
<div class="code"><pre><code>
&lt;%
set output = new StringBuilder
output(&quot;some text&quot;)
output(&quot;some other text&quot;)
%&gt;
&lt;%= output.toString() %&gt;
</code></pre></div></div>
<table cellspacing="0" id="info_19" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>m on 2008-05-07 15:14</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:23 PM</td>
</tr>
</table>
<h2><span onclick="togg('props_19')" style="cursor:pointer">Properties</span> <a href="#class_19" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_19" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">component</td>
<td class="type"><span class="type">string</span></td>
<td>holds the component which should be used. <em>empty</em> = none (common concatination)&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">supportedComponents</td>
<td class="type"><span class="type">array</span></td>
<td>GET:  gets the supported string builder COM components. the order represents the order which will be loaded first if available&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_19')" style="cursor:pointer">Methods</span> <a href="#class_19" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_19" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDARQPMN" onclick="togg('mdetails_19IDARQPMN')">append
										(val)
									</a></div>
<div class="mDesc">appends a string to the builder</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_19IDARQPMN">
<div class="param"><span class="paramName"> val</span><span>
														[<span class="type">string</span>]</span><br>the string you want to append</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAPRPMN" onclick="togg('mdetails_19IDAPRPMN')">toString
										()
									</a></div>
<div class="mDesc">returns the concatenated string</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_19IDAPRPMN">
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>concatenated string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAOPPMN" onclick="togg('mdetails_19IDAOPPMN')" class="default">write
										(val)
									</a></div>
<div class="mDesc">writes a string with the string builder. the difference to append is that it will
output to the response if there is no component found</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_19IDAOPPMN"><li class="list">its recommended to use this instead of <em>append()</em> when rendering html markup. it wil allways use this fastest method. if stringbuilder available then using stringbuilder otherwise direct output to response.</li>
<li class="list">note: be sure that on the place you use <em>write()</em> it can output directly to the response if needed</li><br><br><div class="param"><span class="paramName"> val</span><span>
														[<span class="type">string</span>]</span><br>the string you want to write</div>
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_20"></a><fieldset class="class">
<legend>
						Class StringOperations <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Collection of various useful string operations. An instance of this class
called <em>str</em> is created when loading the page. Thus all methods can easily be
accessed using <em>str.methodName</em></div>
<table cellspacing="0" id="info_20" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>1.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz - gabru at grafix.at, Michael Rebec on 11.12.2003</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:24 PM</td>
</tr>
<tr>
<td class="label">Staticname:</td>
<td><em>str</em></td>
</tr>
</table>
<h2><span onclick="togg('props_20')" style="cursor:pointer">Properties</span> <a href="#class_20" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_20" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
</table>
<h2><span onclick="togg('meths_20')" style="cursor:pointer">Methods</span> <a href="#class_20" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_20" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDAXXWOI" onclick="togg('mdetails_20IDAXXWOI')">arrayToString
										(arr, seperator)
									</a></div>
<div class="mDesc"><span class="obsolete">This method is obsolete.</span>Converts an <em>array</em> to a <em>string</em>. Use native <em>join()</em> function instead</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAXXWOI"><div class="code"><pre><code>&lt;% str.arrayToString(array(1, 2, 3), &quot;,&quot;) '=&gt; 1,2,3 %&gt;</code></pre></div><br><br><div class="param"><span class="paramName">byVal arr</span><span>
														[<span class="type">Array</span>]</span><br>the array you want to concat</div>
<div class="param"><span class="paramName"> seperator</span><span>
														[<span class="type">string</span>]</span><br>seperator between the array fields e.g. <em>,</em></div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>concated array</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAIJXOI" onclick="togg('mdetails_20IDAIJXOI')">ASCIICode
										(str)
									</a></div>
<div class="mDesc">Encodes a string into ASCII Characters</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAIJXOI">This function takes a string (for example an email-address) and converts it to
standardized ASCII Character codes, thus blocking bots/spiders from reading your
email address, while yet allowing visitors to continue to read and use your proper
address via mailto links, etc.<br><br><div class="param"><span class="paramName">byVal str</span><span>
														[<span class="type">string</span>]</span><br>the string you want to convert</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>the ASCII Encoded String</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAJFXOI" onclick="togg('mdetails_20IDAJFXOI')">capitalize
										(inputStr)
									</a></div>
<div class="mDesc">Converts every first letter of every word into uppercase.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAJFXOI">Good for Names or cities. Example: <em>jack johnson</em> will result in <em>Jack Johnson</em><br><br><div class="param"><span class="paramName"> inputStr</span><br></div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>changed string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAOZPMN" onclick="togg('mdetails_20IDAOZPMN')">change
										(source, find, replaceWith)
									</a></div>
<div class="mDesc">an extension of the common <em>replace()</em> function. basically the same
but you can replace more parts in one go.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAOZPMN"><li class="list"><em>find (array)</em> -> <em>replaceWith (string)</em>: every match of 'find' will be replaced with the string</li>
<li class="list"><em>find (array[n])</em> -> <em>replaceWith (array[n])</em>: must be same size! every field will be replaced by the field of replaceWith with the same index.</li>
<li class="list"><em>find (array[n])</em> -> <em>replaceWith (array[m])</em>: n > m! for the missing fields the last one will be taken for replacement. e.g.<div class="code"><pre><code>&lt;% str.change(&quot;somestring&quot;, array(1, 2), array(3)) %&gt;</code></pre></div> means that the 1 will be replaced with 3 and the 2 will also be replaced with 3 because there is no equivalent for the 2</li><br><br><div class="param"><span class="paramName">byVal source</span><span>
														[<span class="type">string</span>]</span><br>the source string in which we search</div>
<div class="param"><span class="paramName"> find</span><span>
														[<span class="type">string</span>, <span class="type">array</span>]</span><br>what you are looking for.</div>
<div class="param"><span class="paramName"> replaceWith</span><span>
														[<span class="type">string</span>, <span class="type">array</span>]</span><br>the value you want to replace the matches with.</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>the replaced source string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAY3WOI" onclick="togg('mdetails_20IDAY3WOI')">clone
										(str, n)
									</a></div>
<div class="mDesc">Concats a string <em>n</em> times</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAY3WOI">
<div class="param"><span class="paramName">byVal str</span><span>
														[<span class="type">string</span>]</span><br>the source string</div>
<div class="param"><span class="paramName"> n</span><span>
														[<span class="type">int</span>]</span><br>the number of concats</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>the concated string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDANEWOI" onclick="togg('mdetails_20IDANEWOI')">defuseHTML
										(value)
									</a></div>
<div class="mDesc">defuses the HTML of given string. so html code wont be recognized as HTML code by browser</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDANEWOI">
<div class="param"><span class="paramName"> value</span><span>
														[<span class="type">string</span>]</span><br>the value which should be defused</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>defused value</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAOOWOI" onclick="togg('mdetails_20IDAOOWOI')">divide
										(inputStr, partitionLength)
									</a></div>
<div class="mDesc">divides a string into several string-paritions of a given length</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAOOWOI">string <em>HAXN</em> will result (<em>partitionlength = 2</em>) in the following array:
<em>array("HA", "XN")</em><br><br><div class="param"><span class="paramName"> inputStr</span><span>
														[<span class="type">string</span>]</span><br>string which should be divided</div>
<div class="param"><span class="paramName">byVal partitionLength</span><span>
														[<span class="type">string</span>]</span><br>the length of each partion</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">array</span>]
											<br>array with all partitions</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA0PWOI">end
										()
									</a></div>
<div class="mDesc">stops to response</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDA0PWOI">
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAM2WOI" onclick="togg('mdetails_20IDAM2WOI')">endsWith
										(str, chars)
									</a></div>
<div class="mDesc">Checks if the string ends with a given string. Case sensitive.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAM2WOI">
<div class="param"><span class="paramName">byVal str</span><span>
														[<span class="type">string</span>]</span><br>the source string</div>
<div class="param"><span class="paramName"> chars</span><span>
														[<span class="type">string</span>]</span><br>the compare char/string</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br>true if the source string ends with the <em>chars</em> string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA3TWOI" onclick="togg('mdetails_20IDA3TWOI')">ensureSlash
										(pathString)
									</a></div>
<div class="mDesc">adds a slash <em>/</em> at the end of the string if there isnt one.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDA3TWOI">Good use for urls or paths if you want to be sure that there is a slash at the end
of an url or a path.<br><br><div class="param"><span class="paramName"> pathString</span><span>
														[<span class="type">string</span>]</span><br>The string (url, path) you want to check</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>the new url. with a slash at the end.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAK1PMN" onclick="togg('mdetails_20IDAK1PMN')">existsIn
										(aString, anArray, caseSensitive)
									</a></div>
<div class="mDesc">checks if a given string can be found in a given <em>array</em></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAK1PMN">all values in the <em>array</em> are treated as strings when comparing<br><br><div class="param"><span class="paramName">byVal aString</span><span>
														[<span class="type">string</span>]</span><br>the string which should be checked against</div>
<div class="param"><span class="paramName">byVal anArray</span><span>
														[<span class="type">array</span>]</span><br>the array with values where the function will walk through</div>
<div class="param"><span class="paramName"> caseSensitive</span><span>
														[<span class="type">bool</span>]</span><br>should the search be case sensitive?</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">int</span>]
											<br>index of the first found field within the <em>array</em>. <em>-1</em> if not found</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAFGXOI" onclick="togg('mdetails_20IDAFGXOI')">format
										(str, values)
									</a></div>
<div class="mDesc">Replaces all <em>{n}</em> placeholders in a given string through the n-index field of a given array.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAFGXOI">Its just like the <em>string.format</em> method in .NET. So if you have a string <em>my Name is {0}</em> as
your input then the <em>{0}</em> will be replaced by the first field of your array. And so on and so forth.
<li class="list">Placeholders can be used multiple times within the source string</li>
<li class="list">In case you get an error about unsupported character sequence, then your string contains a special character sequence which is used internally for escaping (the sequence consists of non printable characters). Thus it cannot be used as input.</li><br><br><div class="param"><span class="paramName">byVal str</span><span>
														[<span class="type">string</span>]</span><br>the source string</div>
<div class="param"><span class="paramName">byVal values</span><span>
														[<span class="type">array</span>, <span class="type">string</span>]</span><br>your values which should replace the placeholders. Use a <em>string</em> if you have only one placeholder to replace</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>changed string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDALHWOI" onclick="togg('mdetails_20IDALHWOI')">getHiddenInput
										(name, value)
									</a></div>
<div class="mDesc">generates a hidden input field and returns the HTML for it</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDALHWOI">
<div class="param"><span class="paramName"> name</span><span>
														[<span class="type">string</span>]</span><br>the name of the value</div>
<div class="param"><span class="paramName"> value</span><span>
														[<span class="type">string</span>]</span><br>the value it should hold</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAWJWOI" onclick="togg('mdetails_20IDAWJWOI')" class="default">HTMLEncode
										(value)
									</a></div>
<div class="mDesc">encodes a value so that any special chars will be transformed into html entities.
e.g. <em>"</em> will converted to <em>&quot;</em></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAWJWOI">should be used in all views to prevent XSS. for that reason its also the default function so its
easier to use. example of usage in your views (as its the default function it can be used directly on the instance):<div class="code"><pre><code>str(&quot;some value &lt;&gt;&quot;)</code></pre></div><br><br><div class="param"><span class="paramName"> value</span><span>
														[<span class="type">string</span>]</span><br>the value you want to encode</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA3SPMN" onclick="togg('mdetails_20IDA3SPMN')">humanize
										(val)
									</a></div>
<div class="mDesc">Takes a string and tries to make it look more humanreadable. Its for creating pretty output</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDA3SPMN"><li class="list"><em>_</em> (underscores) are replaced by a space character (also more underscores e.g. <em>___</em> are replaced by only one space)</li>
<li class="list"><em>_id</em> and <em>_fk</em> in the back are stripped as well as <em>id_</em> and <em>fk_</em> in the beginning</li>
<li class="list">everything is lower cased unless the first letter</li><br><br><div class="param"><span class="paramName">byVal val</span><span>
														[<span class="type">string</span>]</span><br>the value which should be humanized</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>a pretty string. e.g. <em>created_on</em> => <em>Created on</em> or <em>fk_category</em> => <em>Category</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDALDXOI" onclick="togg('mdetails_20IDALDXOI')">isAlphabetic
										(character)
									</a></div>
<div class="mDesc">Checks if given a char is an alphabetic character (<em>A-Z</em> or <em>a-z</em>) or not.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDALDXOI">
<div class="param"><span class="paramName">byVal character</span><span>
														[<span class="type">char</span>]</span><br>The char to check</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br><em>true</em> the char is alphabetic otherwise <em>false</em>.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAWKWOI" onclick="togg('mdetails_20IDAWKWOI')">isValidEmail
										(val)
									</a></div>
<div class="mDesc">checks if a given string is a syntactically correct email address</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAWKWOI">
<div class="param"><span class="paramName"> val</span><span>
														[<span class="type">string</span>]</span><br>the value to check</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br>true if string seems to be an email</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDALGWOI" onclick="togg('mdetails_20IDALGWOI')">JSEncode
										(val)
									</a></div>
<div class="mDesc"></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDALGWOI">Makes a string javascript persistent. Changes special characters, etc.<br><br><div class="param"><span class="paramName">byVal val</span><span>
														[<span class="type">string</span>]</span><br>the value which needs to be encoded</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>encoded string which can be used within javascript strings.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA5VPMN" onclick="togg('mdetails_20IDA5VPMN')">matching
										(val, pattern, ignoreCase)
									</a></div>
<div class="mDesc">checks if a given string is matching a given regular expression pattern</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDA5VPMN">
<div class="param"><span class="paramName"> val</span><span>
														[<span class="type">string</span>]</span><br>the value which needs to be checked against the pattern</div>
<div class="param"><span class="paramName"> pattern</span><span>
														[<span class="type">string</span>]</span><br>regular expression pattern</div>
<div class="param"><span class="paramName"> ignoreCase</span><span>
														[<span class="type">bool</span>]</span><br>ignore the case on comparison</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br><em>true</em> if val matches the pattern otherwise false</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAIZWOI" onclick="togg('mdetails_20IDAIZWOI')">multiArrayToString
										(arr, seperator, dimension)
									</a></div>
<div class="mDesc">Converts a part of a multidimensional <em>array</em> to a <em>string</em></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAIZWOI">
<div class="param"><span class="paramName">byVal arr</span><span>
														[<span class="type">Array</span>]</span><br>the array you want to concat</div>
<div class="param"><span class="paramName"> seperator</span><span>
														[<span class="type">string</span>]</span><br>seperator between the array-fields</div>
<div class="param"><span class="paramName"> dimension</span><span>
														[<span class="type">int</span>]</span><br>the dimension index in the array e.g. you have an
array of the size <em>(5, 2)</em> -> with <em>dimension</em> <em>2</em> you get the array fields
<em>(0, 2), (1, 2)</em>, ..., <em>(4, 2)</em> as a string.</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>concated array</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAULWOI" onclick="togg('mdetails_20IDAULWOI')">nullIfEmpty
										(value)
									</a></div>
<div class="mDesc">returns null if the input is empty.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAULWOI">
<div class="param"><span class="paramName"> value</span><span>
														[<span class="type">variant</span>]</span><br>the value you are dealing with</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">variant</span>]
											<br><em>null</em> if the value is <em>empty</em>, otherwise the value itself</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDABBWOI" onclick="togg('mdetails_20IDABBWOI')">padLeft
										(value, totalLength, paddingChar)
									</a></div>
<div class="mDesc">right-aligns a given value by padding left a given character to a totalsize</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDABBWOI">example: input: <em>22</em> -> output: <em>00022</em> (padded to total length of 5 with the paddingchar 0)<br><br><div class="param"><span class="paramName"> value</span><span>
														[<span class="type">string</span>]</span><br>the value which should be aligned right</div>
<div class="param"><span class="paramName"> totalLength</span><span>
														[<span class="type">string</span>]</span><br>whats the total Length of the result string</div>
<div class="param"><span class="paramName"> paddingChar</span><span>
														[<span class="type">string</span>]</span><br>the char which is taken for padding</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>right aligned string.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAXCWOI" onclick="togg('mdetails_20IDAXCWOI')">padRight
										(value, totalLength, paddingChar)
									</a></div>
<div class="mDesc">left-aligns a given value by padding right a given character to a totalsize</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAXCWOI">example: input: <em>22</em> -> output: <em>22000</em> (padded to total length of 5 with the paddingchar 0)<br><br><div class="param"><span class="paramName"> value</span><span>
														[<span class="type">string</span>]</span><br>the value which should be aligned left</div>
<div class="param"><span class="paramName"> totalLength</span><span>
														[<span class="type">string</span>]</span><br>whats the total Length of the result string</div>
<div class="param"><span class="paramName"> paddingChar</span><span>
														[<span class="type">string</span>]</span><br>the char which is taken for padding</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>left aligned string.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAE3PMN" onclick="togg('mdetails_20IDAE3PMN')">parse
										(value, alternative)
									</a></div>
<div class="mDesc">Tries to parse a given value into the datatype of the given <em>alternative</em>. If it cannot be parsed
then the <em>alternative</em> is passed through. In other words: It ensures that a given variable contains only one datatype.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAE3PMN">It ALWAYS returns the type of the alternative. Recommended usage when getting values from querystring or form:
<div class="code"><pre><code>
'gets the ID value from querystring and ensures its an integer.
'if it cannot be parsed then always 0 is returned
id = str.parse(page.QS(&quot;id&quot;), 0)
'the same with a form value
id = str.parse(page.RF(&quot;id&quot;), 0)
'parsing to a float number
nr = str.parse(&quot;212.22&quot;, 0.0)
</code></pre></div><br><br><div class="param"><span class="paramName"> value</span><span>
														[<span class="type">string</span>]</span><br>value which should be parsed.
Float values are only recognized with the comma which is common for the current locale (check <em>local.comma</em>.
<div class="code"><pre><code>
&lt;%
'e.g. US
str.parse(&quot;12.3&quot;, 0.0) ' =&gt; 12.3
str.parse(&quot;12,3&quot;, 0.0) ' =&gt; 123
'e.g. Germany
str.parse(&quot;12.3&quot;, 0.0) ' =&gt; 123
str.parse(&quot;12,3&quot;, 0.0) ' =&gt; 12.3
%&gt;
</code></pre></div></div>
<div class="param"><span class="paramName"> alternative</span><span>
														[<span class="type">variant</span>]</span><br>alternative value if converting is not possible
<li class="list">if a <em>float</em> value is needed then use a comma. e.g. <em>0.0</em></li></div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">variant</span>]
											<br>the string parsed into the alternative type or the alternative itself</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA3TPMN" onclick="togg('mdetails_20IDA3TPMN')">rReplace
										(val, pattern, replaceWith, ignoreCase)
									</a></div>
<div class="mDesc">performs a replace with a regular expression pattern</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDA3TPMN">e.g. surrounding all numbers of a string with brackets:<div class="code"><pre><code>&lt;% str.rReplace(&quot;i am 20 and he is 10&quot;, &quot;(\d)&quot;, &quot;($1)&quot;, true) %&gt;</code></pre></div><br><br><div class="param"><span class="paramName"> val</span><span>
														[<span class="type">string</span>]</span><br>the value you want to replace the matches</div>
<div class="param"><span class="paramName"> pattern</span><span>
														[<span class="type">string</span>]</span><br>regular expression pattern</div>
<div class="param"><span class="paramName"> replaceWith</span><span>
														[<span class="type">string</span>]</span><br>a string which is used for the replacement of the matches
<li class="list"><em>$1, $2</em>, .. can be used as placeholders for grouped expressions of the regex pattern</li></div>
<div class="param"><span class="paramName"> ignoreCase</span><span>
														[<span class="type">bool</span>]</span><br>ignore the case on comparison</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>returns the new string with replacements made. if no replacements made then the same string is returned as given on input</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAPQWOI" onclick="togg('mdetails_20IDAPQWOI')">shorten
										(str, maxChars, overflowString)
									</a></div>
<div class="mDesc">Shortens a string and adds a custom string at the end if string is longer than a given value.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAPQWOI">Useful if you want to display excerpts:
<div class="code"><pre><code>&lt;%= str.shorten(&quot;some value&quot;, 10, &quot;...&quot;) %&gt;</code></pre></div><br><br><div class="param"><span class="paramName">byVal str</span><span>
														[<span class="type">string</span>]</span><br>string which should be checked against cutting</div>
<div class="param"><span class="paramName"> maxChars</span><span>
														[<span class="type">string</span>]</span><br>whats the maximum allowed length of chars</div>
<div class="param"><span class="paramName"> overflowString</span><span>
														[<span class="type">int</span>]</span><br>what string should be added at the end of the string if it has been cutted</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>cutted string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAHSWOI" onclick="togg('mdetails_20IDAHSWOI')">splitValue
										(stringToSplit, delimiter, returnIndex)
									</a></div>
<div class="mDesc">splits a string and returns a specified field of the array</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAHSWOI">it uses the split function but immediately returns you the field you want.<br><br><div class="param"><span class="paramName"> stringToSplit</span><span>
														[<span class="type">string</span>]</span><br>the string you want to split</div>
<div class="param"><span class="paramName"> delimiter</span><span>
														[<span class="type">string</span>]</span><br>whats the delimiter for splitting</div>
<div class="param"><span class="paramName"> returnIndex</span><span>
														[<span class="type">int</span>]</span><br>what index should be returned after spliting?. <em>-1</em> = get the last index</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>string content for the needed field of the <em>array</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDALFWOI" onclick="togg('mdetails_20IDALFWOI')">SQLSafe
										(value)
									</a></div>
<div class="mDesc"><span class="obsolete">This method is obsolete.</span>makes a given string safe for the use within sql statements. This function is obsolete and
<em>db.SQLSafe()</em> should be used instead.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDALFWOI">e.g. if its necessary to pass through an user input directly into a sql-query
example on a basic login scenario:<div class="code"><pre><code>&lt;% sql = &quot;SELECT * FROM user WHERE login = &quot; &amp; str.SQLSafe(username) %&gt;</code></pre></div><br><br><div class="param"><span class="paramName"> value</span><span>
														[<span class="type">string</span>]</span><br>the value which should be made "safe"</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>safe value. e.g. <em>'</em> are escaped with <em>''</em>, etc.</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAA1WOI" onclick="togg('mdetails_20IDAA1WOI')">startsWith
										(str, chars)
									</a></div>
<div class="mDesc">Checks if the string begins with a given string. Case sensitive.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAA1WOI">
<div class="param"><span class="paramName">byVal str</span><span>
														[<span class="type">string</span>]</span><br>the source string</div>
<div class="param"><span class="paramName"> chars</span><span>
														[<span class="type">string</span>]</span><br>the compare char/string</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br>true if source string starts with the <em>chars</em> string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAQNWOI" onclick="togg('mdetails_20IDAQNWOI')">stripTags
										(inputStr)
									</a></div>
<div class="mDesc">removes all Tags from a given string</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAQNWOI">Tags are defined as string-parts surrounded by a <em><</em> and a <em>></em>. example: <em>&lt;sample&gt;</em><br><br><div class="param"><span class="paramName"> inputStr</span><span>
														[<span class="type">string</span>]</span><br>string where the Tags should be removed</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>the input-String without any Tags</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDALEXOI" onclick="togg('mdetails_20IDALEXOI')">swapCase
										(str)
									</a></div>
<div class="mDesc">Swaps the Case of a String. lowercase chars to uppercase and vice a versa</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDALEXOI">
<div class="param"><span class="paramName"> str</span><span>
														[<span class="type">string</span>]</span><br>the source string</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>the swapped string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAXWWOI" onclick="togg('mdetails_20IDAXWWOI')">toCharArray
										(str)
									</a></div>
<div class="mDesc">Converts a <em>string</em> to a CHAR <em>array</em></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAXWWOI">
<div class="param"><span class="paramName">byVal str</span><span>
														[<span class="type">string</span>]</span><br>the string you want to convert</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">array</span>]
											<br>a "char" array</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAO4PMN" onclick="togg('mdetails_20IDAO4PMN')">toFloat
										(value, alternative)
									</a></div>
<div class="mDesc"><span class="obsolete">This method is obsolete.</span>use <em>parse()</em> instead</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAO4PMN">
<div class="param"><span class="paramName"> value</span><br></div>
<div class="param"><span class="paramName"> alternative</span><br></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAW5PMN" onclick="togg('mdetails_20IDAW5PMN')">toInt
										(value, alternative)
									</a></div>
<div class="mDesc"><span class="obsolete">This method is obsolete.</span>use <em>parse()</em> instead</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAW5PMN">
<div class="param"><span class="paramName"> value</span><br></div>
<div class="param"><span class="paramName"> alternative</span><br></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDASMWOI" onclick="togg('mdetails_20IDASMWOI')">trimComplete
										(inputStr)
									</a></div>
<div class="mDesc">removes all non-printable chars from the end and the beginning of the string</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDASMWOI">spaces, returns, line-feeds, tabs, etc. will be removed<br><br><div class="param"><span class="paramName"> inputStr</span><span>
														[<span class="type">string</span>]</span><br>string to be trimmed</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>trimmed string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDATAXOI" onclick="togg('mdetails_20IDATAXOI')">trimEnd
										(str, n)
									</a></div>
<div class="mDesc">Removes a given amount of characters from the end of a string</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDATAXOI">
<div class="param"><span class="paramName">byVal str</span><span>
														[<span class="type">string</span>]</span><br>the source string</div>
<div class="param"><span class="paramName"> n</span><span>
														[<span class="type">int</span>]</span><br>the number of characters you want to remove</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>the trimmed string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAE5WOI" onclick="togg('mdetails_20IDAE5WOI')">trimStart
										(str, n)
									</a></div>
<div class="mDesc">Removes a given amount of characters from the begining of a string</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAE5WOI">
<div class="param"><span class="paramName">byVal str</span><span>
														[<span class="type">string</span>]</span><br>the source string</div>
<div class="param"><span class="paramName"> n</span><span>
														[<span class="type">int</span>]</span><br>the number of characters you want to remove</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>the trimmed string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA5BXOI" onclick="togg('mdetails_20IDA5BXOI')">trimString
										(str, stringToTrim)
									</a></div>
<div class="mDesc">Removes characters from a given string with all occurencies of a matching string</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDA5BXOI">
<div class="param"><span class="paramName">byVal str</span><span>
														[<span class="type">string</span>]</span><br>the source string</div>
<div class="param"><span class="paramName"> stringToTrim</span><span>
														[<span class="type">string</span>]</span><br>the string which will be trimmed out of the string</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>the trimmed string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAVXPMN" onclick="togg('mdetails_20IDAVXPMN')">URL
										(path, params, anchor)
									</a></div>
<div class="mDesc">returns a full URL with a given file and given parameters</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAVXPMN">it encodes automatically the values of the parameters.<br><br><div class="param"><span class="paramName"> path</span><span>
														[<span class="type">string</span>]</span><br>the path to the file. e.g. <em>/file.asp</em>, <em>f.asp</em>, <em>http://domain.com/f.asp</em></div>
<div class="param"><span class="paramName"> params</span><span>
														[<span class="type">string</span>, <span class="type">array</span>]</span><br>the parameters for the url (querystring). if its an <em>array</em>
then every even field is the name and every odd field is the value. if its a <em>string</em>
then its treated as jusst one parameter value for the URL. e.g. <em>file.asp?oneValue</em></div>
<div class="param"><span class="paramName"> anchor</span><br></div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>an URL build with the parameters and fully URL-encoded. example: <em>/file.asp?x=10</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA1UWOI" onclick="togg('mdetails_20IDA1UWOI')">write
										(value)
									</a></div>
<div class="mDesc">writes a string to the output in the same line</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDA1UWOI">
<div class="param"><span class="paramName"> value</span><span>
														[<span class="type">string</span>]</span><br>output string</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAYIWOI" onclick="togg('mdetails_20IDAYIWOI')">writeEnd
										(value)
									</a></div>
<div class="mDesc">writes a value to the output and stops the response.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAYIWOI">The response will be stopped after writing the value. good for debuging.<br><br><div class="param"><span class="paramName"> value</span><span>
														[<span class="type">string</span>]</span><br>the value you want to write</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAVHXOI" onclick="togg('mdetails_20IDAVHXOI')">writef
										(str, values)
									</a></div>
<div class="mDesc">Writes a formatted string. (combination of <em>write()</em> and <em>format()</em>)</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAVHXOI">
<div class="param"><span class="paramName">byVal str</span><span>
														[<span class="type">string</span>]</span><br>the source string</div>
<div class="param"><span class="paramName">byVal values</span><span>
														[<span class="type">array</span>, <span class="type">string</span>]</span><br>your values which should replace the placeholders. Use a <em>string</em> if you have only one placeholder to replace. Check <em>format()</em> function for more details</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAZVWOI" onclick="togg('mdetails_20IDAZVWOI')">writeln
										(value)
									</a></div>
<div class="mDesc">writes a line to the output</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_20IDAZVWOI">
<div class="param"><span class="paramName"> value</span><span>
														[<span class="type">string</span>]</span><br>output string</div>
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_21"></a><fieldset class="class">
<legend>
						Class TestFixture <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Represents a test fixture which can consist of one ore more tests.
<li class="list">Tests must be subs which are named <em>test_1()</em>, <em>test_2()</em>, etc. </li>
<li class="list">Call the different assert methods within your tests</li>
<li class="list">if you need to debug your failures then turn on the <em>debug</em> property</li>
<li class="list">create a <em>setup()</em> sub if you need a procedure which will be called before every test</li>
<li class="list">run the fixture with the <em>run()</em> method</li>
Example of a simple test (put this in an own file):
<div class="code"><pre><code>
&lt;!--#include virtual=&quot;/ajaxed/class_TestFixture/testFixture.asp&quot;--&gt;
&lt;%
set tf = new TestFixture
tf.run()

sub test_1()
    tf.assert 1 = 1, &quot;1 is not equal 2&quot;
    'Lets test if our home page works
    tf.assertResponse &quot;/default.asp&quot;, empty, &quot;&lt;h1&gt;Welcome&lt;/h1&gt;&quot;, &quot;Welcome page seems not to work&quot;
end sub
%&gt;
</code></pre></div></div>
<table cellspacing="0" id="info_21" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>michal on 2008-04-03 19:21</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:25 PM</td>
</tr>
</table>
<h2><span onclick="togg('props_21')" style="cursor:pointer">Properties</span> <a href="#class_21" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_21" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">allEnvs</td>
<td class="type"><span class="type">bool</span></td>
<td>should the test run on all environments? default = <em>false</em> (tests run only on DEV env if this option is enabled).
Enabling this option should be done only if the test files are somehow protected from public access (e.g. http basic authentication).&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">debug</td>
<td class="type"><span class="type">bool</span></td>
<td>Turn this on to debug your tests. error handling is turned off then. default = <em>false</em>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">lineBreak</td>
<td class="type"><span class="type">string</span></td>
<td>The line break which should be used between each message. default = <em>&lt;br&gt;</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">requestTimeout</td>
<td class="type"><span class="type">int</span></td>
<td>Timout for page requests. e.g. when using <em>asserResponse()</em> default = <em>3</em>&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_21')" style="cursor:pointer">Methods</span> <a href="#class_21" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_21" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDATSXOI" onclick="togg('mdetails_21IDATSXOI')">assert
										(truth, msg)
									</a></div>
<div class="mDesc">Expects a value to be <em>true</em></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDATSXOI">
<div class="param"><span class="paramName"> truth</span><span>
														[<span class="type">bool</span>]</span><br>the boolean expression which should be <em>true</em> in order to pass the test</div>
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>]</span><br>A message which will be shown if the assert fails</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAHVXOI" onclick="togg('mdetails_21IDAHVXOI')">assertEqual
										(expected, actual, msg)
									</a></div>
<div class="mDesc">Expects two values to be equal</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDAHVXOI">You can also compare more values by providing arrays as parameters. All values are compared against each other and must be equal and on the same position.
<div class="code"><pre><code>
&lt;%
'this will fail
assertResponse 1, 2, &quot;values are not equal&quot;
'array equality (will pass)
assertResponse array(1, 2), array(1, 2), &quot;arrays are not equal&quot;
'array equality (both will fail)
assertResponse array(1, 2), array(1, 3), &quot;arrays are not equal&quot;
assertResponse array(1, 2), array(1), &quot;arrays are not equal&quot;
%&gt;
</code></pre></div><br><br><div class="param"><span class="paramName"> expected</span><span>
														[<span class="type">variant</span>, <span class="type">array</span>]</span><br>The value(s) you expect.</div>
<div class="param"><span class="paramName"> actual</span><span>
														[<span class="type">variant</span>, <span class="type">array</span>]</span><br>The actal value(s).</div>
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>]</span><br>A message which will be shown if the assert fails</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDABXXOI" onclick="togg('mdetails_21IDABXXOI')">assertHas
										(data, expected, msg)
									</a></div>
<div class="mDesc">Expects a value to be contained within a given data structure</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDABXXOI">
<div class="param"><span class="paramName"> data</span><span>
														[<span class="type">array</span>]</span><br>Must be an <em>array</em>. if it is not an <em>array</em> then the assert will fail.</div>
<div class="param"><span class="paramName"> expected</span><span>
														[<span class="type">variant</span>]</span><br>The value you expects to exist within the <em>data</em></div>
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>]</span><br>A message which will be shown if the assert fails</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA0YXOI" onclick="togg('mdetails_21IDA0YXOI')">assertHasNot
										(data, expected, msg)
									</a></div>
<div class="mDesc">Expects a value NOT to be contained within a given data structure</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDA0YXOI">
<div class="param"><span class="paramName"> data</span><span>
														[<span class="type">array</span>]</span><br>Must be an <em>array</em>. If data is not an <em>array</em> then the assert will succeed (because its not in it)</div>
<div class="param"><span class="paramName"> expected</span><span>
														[<span class="type">variant</span>]</span><br>The value you expect NOT be in within the <em>data</em></div>
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>]</span><br>A message which will be shown if the assert fails</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDADBYOI" onclick="togg('mdetails_21IDADBYOI')">assertInDelta
										(expected, actual, delta, msg)
									</a></div>
<div class="mDesc">Expects two values to be equal with a given delta</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDADBYOI"><div class="code"><pre><code>
&lt;%
'these will pass
assertInDelta 10, 11, 1, &quot;Something is wrong&quot;
assertInDelta 5.4, 5.4, 0.1, &quot;Something is wrong&quot;
assertInDelta 5.4, 5.3, 0.1, &quot;Something is wrong&quot;
'those will fail
assertInDelta 4.4, 4.5, 0.1, &quot;Something is wrong&quot;
assertInDelta 33, 12, 10, &quot;Something is wrong&quot;
%&gt;
</code></pre></div><br><br><div class="param"><span class="paramName"> expected</span><span>
														[<span class="type">int</span>, <span class="type">float</span>]</span><br>The expected value</div>
<div class="param"><span class="paramName"> actual</span><span>
														[<span class="type">int</span>, <span class="type">float</span>]</span><br>The actual value</div>
<div class="param"><span class="paramName"> delta</span><span>
														[<span class="type">int</span>, <span class="type">float</span>]</span><br>Delta which represents the tolerance for the comparison of <em>expected</em> and <em>actual</em>.</div>
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>]</span><br>A message which will be shown if the assert fails</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAEPXOI" onclick="togg('mdetails_21IDAEPXOI')">assertInFile
										(virtualFilePath, stringToFind, msg)
									</a></div>
<div class="mDesc">expects a string to exist in a given file.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDAEPXOI">Will fail if the file does not exist at all. <strong>Case sensitive</strong>.<br><br><div class="param"><span class="paramName"> virtualFilePath</span><span>
														[<span class="type">string</span>]</span><br>virtual path to the file e.g. /test.txt</div>
<div class="param"><span class="paramName"> stringToFind</span><span>
														[<span class="type">string</span>]</span><br>The string which you expect to be in the file</div>
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>]</span><br>A message which will be shown if the assert fails</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAK2XOI" onclick="togg('mdetails_21IDAK2XOI')">assertInstanceOf
										(expectedClassName, value, msg)
									</a></div>
<div class="mDesc">Expects a value to be of a given type (class)</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDAK2XOI">
<div class="param"><span class="paramName"> expectedClassName</span><span>
														[<span class="type">string</span>]</span><br>expected class name e.g. <em>User</em></div>
<div class="param"><span class="paramName"> value</span><span>
														[<span class="type">variant</span>]</span><br>The value which type will be checked.</div>
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>]</span><br>A message which will be shown if the assert fails</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAA4XOI" onclick="togg('mdetails_21IDAA4XOI')">assertMatch
										(pattern, value, msg)
									</a></div>
<div class="mDesc">Expects a value to match a given regular expression pattern</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDAA4XOI">It uses <em>str.matching()</em> internally.<br><br><div class="param"><span class="paramName"> pattern</span><span>
														[<span class="type">string</span>]</span><br>The regular expression pattern which will be used for matching.</div>
<div class="param"><span class="paramName"> value</span><span>
														[<span class="type">string</span>]</span><br>The value which wil be checked against the <em>pattern</em></div>
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>]</span><br>A message which will be shown if the assert fails</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA3TXOI" onclick="togg('mdetails_21IDA3TXOI')">assertNot
										(expected, msg)
									</a></div>
<div class="mDesc">Expects a value to be <em>false</em></div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDA3TXOI">
<div class="param"><span class="paramName"> expected</span><span>
														[<span class="type">bool</span>]</span><br>the boolean expression which should be <em>false</em> in order to pass the test</div>
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>]</span><br>A message which will be shown if the assert fails</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAQ0XOI" onclick="togg('mdetails_21IDAQ0XOI')">assertNotEqual
										(expected, actual, msg)
									</a></div>
<div class="mDesc">Expects two values not to be equal</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDAQ0XOI">You can also compare more values by providing arrays as parameters. All values are compared against each other and must be equal and on the same position.<br><br><div class="param"><span class="paramName"> expected</span><span>
														[<span class="type">variant</span>, <span class="type">array</span>]</span><br>The value(s) you expect.</div>
<div class="param"><span class="paramName"> actual</span><span>
														[<span class="type">variant</span>, <span class="type">array</span>]</span><br>The actal value(s).</div>
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>]</span><br>A message which will be shown if the assert fails</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAW5XOI" onclick="togg('mdetails_21IDAW5XOI')">assertNothing
										(value, msg)
									</a></div>
<div class="mDesc">expects a value to be nothing (<em>object</em>)</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDAW5XOI">
<div class="param"><span class="paramName"> value</span><span>
														[<span class="type">variant</span>]</span><br>Value which will be checked</div>
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>]</span><br>A message which will be shown if the assert fails</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA3QXOI" onclick="togg('mdetails_21IDA3QXOI')">assertNotInFile
										(virtualFilePath, stringToFind, msg)
									</a></div>
<div class="mDesc">Expects a string NOT to exist in a given file.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDA3QXOI">Will succeed if the file does not exists. <strong>Case sensitive</strong><br><br><div class="param"><span class="paramName"> virtualFilePath</span><span>
														[<span class="type">string</span>]</span><br>virtual path to the file e.g. /test.txt</div>
<div class="param"><span class="paramName"> stringToFind</span><span>
														[<span class="type">string</span>]</span><br>The string which you expect NOT to be in the file</div>
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>]</span><br>A message which will be shown if the assert fails</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA4MXOI" onclick="togg('mdetails_21IDA4MXOI')">assertResponse
										(url, params, pattern, msg)
									</a></div>
<div class="mDesc">Checks if a given url contains a given response (defined with a regex pattern)</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDA4MXOI"><li class="list">will fail if the <em>url</em> cannot be reached</li>
<li class="list">the regular expression will run <strong>not</strong> case sensitive</li>
<li class="list">if <em>debug</em> is on then the whole response will be shown if the assert fails</li>
<li class="list">assert will fail if the page does not return SUCCESS status code (<em>200</em>)</li>
<div class="code"><pre><code>
&lt;%
'checks if the default.asp contains a &lt;h1&gt; tag
assertResponse &quot;/default.asp&quot;, empty, &quot;&lt;h1&gt;.*&lt;/h1&gt;&quot;, &quot;Default.asp seem not to work&quot;

'checks if the login.asp contains a &lt;div&gt; tag with a css class &quot;error&quot; when being posted
assertResponse array(&quot;POST&quot;, &quot;/login.asp&quot;), empty, &quot;&lt;div class=&quot;&quot;error&quot;&quot;&gt;&quot;, &quot;Using login without any credentials should return an error&quot;
%&gt;
</code></pre></div><br><br><div class="param"><span class="paramName">byVal url</span><span>
														[<span class="type">string</span>, <span class="type">array</span>]</span><br>url to request.
<li class="list">if a <em>string</em> then it will be requested with <em>GET</em> method</li>
<li class="list">if an <em>array</em> then first field is the desired method and the 2nd field the actual url e.g. <em>array(method, url)</em></li>
<li class="list">only full (<em>http://...</em>) or virtual (starting with <em>/</em>) urls are allowed</li></div>
<div class="param"><span class="paramName">byVal params</span><span>
														[<span class="type">array</span>]</span><br>parameters for the request. Even fields of the array hold the names and the odd fields hold the corresponding values.
<li class="list">if <em>POST</em> request then send as <em>POST</em> values (if querystring values needed then add them direclty to the URL).</li>
<li class="list">if <em>GET</em> request then send via querystring. </li>
<li class="list">provide <em>empty</em> if no parameters are needed</li></div>
<div class="param"><span class="paramName"> pattern</span><span>
														[<span class="type">string</span>]</span><br>regex pattern which will be checked against after <em>url</em> has been fetched</div>
<div class="param"><span class="paramName"> msg</span><br></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDALDYOI" onclick="togg('mdetails_21IDALDYOI')">fail
										(msg)
									</a></div>
<div class="mDesc">Allows to manually fail an assert</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDALDYOI">
<div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>]</span><br>message which describes the failure</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAJEYOI" onclick="togg('mdetails_21IDAJEYOI')">info
										(msg)
									</a></div>
<div class="mDesc">prints an information message to the output.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDAJEYOI">useful e.g. on testing email. after the test you could inform the user that a specific amount
of emails should be now in his inbox.<br><br><div class="param"><span class="paramName"> msg</span><span>
														[<span class="type">string</span>]</span><br>message which contains the information</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAMMXOI" onclick="togg('mdetails_21IDAMMXOI')">run
										()
									</a></div>
<div class="mDesc">Runs all defined tests of the test fixture</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_21IDAMMXOI">Executes all subs starting with <em>test_</em> followed by a number. Numbers must start with <em>1</em>.
The execution will stop if no test with the next number is found. Thus is you define <em>test_1()</em>, <em>test_2()</em> and <em>test_4()</em> tests then the 4th test wont run because there is no 3rd test.
<li class="list">if there is a <em>setup()</em> sub then its called before every test</li><br><br></div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_23"></a><fieldset class="class">
<legend>
						Class TextTemplate <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Represents a textbased template which can be used as content for emails, etc.
It uses a file and replaces given placeholders with specific values. Placeholders can
be common name value pairs or even whole blocks which hold name value pairs and can be
duplicated several times. It's possible to create, modify and delete the templates.
Example for the usage as an email template (first line of the template is used as subject):
This is how a template would look like:
<div class="code"><pre><code>
Welcome!
Dear &lt;&lt;&lt; name &gt;&gt;&gt;,
Thanks joining us!
We belive your age must be &lt;&lt;&lt; age | not specified &gt;&gt;&gt;.
</code></pre></div>
The following code is required to us the template above:
<div class="code"><pre><code>
&lt;%
set t = new TextTemplate
t.filename = &quot;/templateFileName.txt&quot;
t.add &quot;name&quot;, &quot;John Doe&quot;
email.subject = t.getFirstLine()
email.body = t.getAllButFirstLine()
%&gt;
</code></pre></div>
<strong>Note:</strong> The age placeholder has not been used in the code.
For that reason the <em>TextTemplate</em> will return its default value which can be
specified after the <em>|</em> (pipe) sign. It can be read as 'display age or "not specified" if no age available'</div>
<table cellspacing="0" id="info_23" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>1.3</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz - gabru at grafix.at on 24.10.2003</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:27 PM</td>
</tr>
</table>
<h2><span onclick="togg('props_23')" style="cursor:pointer">Properties</span> <a href="#class_23" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_23" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">cleanParse</td>
<td class="type"><span class="type">bool</span></td>
<td>should all unused blocks, vars, etc. been removed after parsing? default = <em>true</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">content</td>
<td class="type"><span class="type">string</span></td>
<td>GET:  If no content is provided, we load the conents of the given file
SET:  Provide your own content.&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">fileName</td>
<td class="type"><span class="type">string</span></td>
<td>The virtual path including the filename of your template. e.g. <em>/userfiles/t.html</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">placeHolderBegin</td>
<td class="type"><span class="type">string</span></td>
<td>If you want to use your own placeholder characters. this is the beginning. e.g. <em>&lt;&lt;&lt;</em>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">placeHolderEnd</td>
<td class="type"><span class="type">string</span></td>
<td>If you want to use your own placeholder characters. this is the ending. e.g. <em>&gt;&gt;&gt;</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">UTF8</td>
<td class="type"><span class="type">bool</span></td>
<td>is the template saved as UTF8 and should it be stored as UTF8? default = <em>true</em>&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_23')" style="cursor:pointer">Methods</span> <a href="#class_23" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_23" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDAYLYOI" onclick="togg('mdetails_23IDAYLYOI')">add
										(varName, varValue)
									</a></div>
<div class="mDesc">Adds a variable/block which should be replaced within the template</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_23IDAYLYOI">All placeholders in the template using this name (e.g. <em>&lt;&lt;&lt; VARNAME &gt;&gt;&gt;</em>) will be replaced by the
value of the given variable. if the value was already added then it will be updated by the new value<br><br><div class="param"><span class="paramName"> varName</span><span>
														[<span class="type">string</span>]</span><br>The name of your variable
when providing a Block the varname is the name of the block you want to add.</div>
<div class="param"><span class="paramName"> varValue</span><span>
														[<span class="type">string</span>, <a class="type" href="#class_22">TextTemplateBlock</a>]</span><br>The value which will be used.
if its a block then provide a <em>TextTemplateBlock</em> instance</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAENYOI" onclick="togg('mdetails_23IDAENYOI')">addVariable
										(varName, varValue)
									</a></div>
<div class="mDesc">Alias for <em>add()</em>.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_23IDAENYOI">
<div class="param"><span class="paramName"> varName</span><br></div>
<div class="param"><span class="paramName"> varValue</span><br></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAVQYOI">delete
										()
									</a></div>
<div class="mDesc">Deletes the text template file</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_23IDAVQYOI">
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAOPYOI">getAllButFirstLine
										()
									</a></div>
<div class="mDesc">Returns the parsed file without the first line</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_23IDAOPYOI">
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA2OYOI" onclick="togg('mdetails_23IDA2OYOI')">getFirstLine
										()
									</a></div>
<div class="mDesc">Returns the first line of the template file</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_23IDA2OYOI">Returns the content of the first line of the template file.
The place holders will be parsed as well<br><br></div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAKOYOI">returnString
										()
									</a></div>
<div class="mDesc">Returns a string where the template and the placeholders are merged</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_23IDAKOYOI">
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDADQYOI">save
										()
									</a></div>
<div class="mDesc">Saves the text template to the template directory</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_23IDADQYOI">
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_22"></a><fieldset class="class">
<legend>
						Class TextTemplateBlock <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Represents a block which is used within a <em>TextTemplate</em>.
Blocks are defined with <em>&lt;&lt;&lt; BLOCK NAME &gt;&gt;&gt;</em> ... <em>&lt;&lt;&lt; BLOCKEND NAME &gt;&gt;&gt;</em>. Placeholders may be defined between the
begining and the ending of the block. Example of a block
<div class="code"><pre><code>
&lt;&lt;&lt; BLOCK DETAILS &gt;&gt;&gt;
Name: &lt;&lt;&lt; NAME &gt;&gt;&gt;
&lt;&lt;&lt; BLOCKEND DETAILS &gt;&gt;&gt;
</code></pre></div></div>
<table cellspacing="0" id="info_22" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.1</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz on 2006-10-28 14:36</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:28 PM</td>
</tr>
<tr>
<td class="label">Friend of:</td>
<td><a class="type" href="#class_23">TextTemplate</a></td>
</tr>
</table>
<h2><span onclick="togg('props_22')" style="cursor:pointer">Properties</span> <a href="#class_22" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_22" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">items</td>
<td class="type"><a class="type" href="http://www.w3schools.com/asp/asp_ref_dictionary.asp" target="_blank">dictionary</a></td>
<td>Items of the block. <em>key</em> = autoID, <em>value</em> = <em>array</em> with vars.&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_22')" style="cursor:pointer">Methods</span> <a href="#class_22" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_22" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDATGYOI" onclick="togg('mdetails_22IDATGYOI')">addItem
										(vars)
									</a></div>
<div class="mDesc">Adds an item to the block.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_22IDATGYOI">The number of items will result in the same number of copied blocks.<br><br><div class="param"><span class="paramName"> vars</span><span>
														[<span class="type">array</span>]</span><br>A paired <em>array</em>. so 1st value is the name of the 1st var and 2nd value is
is the value of the 1st var, etc. therfore number of values must be even!
Example:<div class="code"><pre><code>&lt;% vars = array(var1, value1, var2, value2, ...) %&gt;</code></pre></div></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDARHYOI" onclick="togg('mdetails_22IDARHYOI')">addRS
										(dataRS)
									</a></div>
<div class="mDesc">Adds all rows of a given recordset to the block.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_22IDARHYOI"><li class="list">The recordset is traversed from its current position.</li><br><br><div class="param"><span class="paramName"> dataRS</span><span>
														[<a class="type" href="http://www.w3schools.com/ado/ado_ref_recordset.asp" target="_blank">recordset</a>]</span><br>The name of the placeHolders within the block match the recordsets field names.</div>
</div>
</td>
</tr>
</table>
</fieldset><br><br><a name="class_24"></a><fieldset class="class">
<legend>
						Class Validator <a class="notForPrint" href="#top" style="text-decoration:none;">^</a></legend>
<div class="cDescription">Represents a general validation container which can be used for the validation of business objects
or any other kind of validation.
It stores invalid fields (e.g. property of a class) with an associated error message
(why is the field invalid). The underlying storage is a dictionary.
<li class="list">It implements a <em>reflect()</em> method thus it can be used nicely on callbacks. A callback could return a whole validator ;)</li>
Example of simple usage:
<div class="code"><pre><code>
&lt;%
set v = new Validator
if lastname = &quot;&quot; then v.add &quot;lastname&quot;, &quot;Lastname cannot be empty&quot;
if str.parse(age, 0) &lt;= 0 then v.add &quot;age&quot;, &quot;Age must be a number and greater than 0&quot;
if v then
    save()
else
    str.write(v.getErrorSummary(&quot;&lt;ul&gt;&quot;, &quot;&lt;/ul&gt;&quot;, &quot;&lt;li&gt;&quot;, &quot;&lt;/li&gt;&quot;))
end if
%&gt;
</code></pre></div></div>
<table cellspacing="0" id="info_24" cellpadding="3" border="0">
<tr>
<td class="label">Version:</td>
<td>0.2</td>
</tr>
<tr>
<td class="label">Author:</td>
<td>Michal Gabrukiewicz on 2005-02-06 15:25</td>
</tr>
<tr>
<td class="label" nowrap>Last modified:</td>
<td>11/27/2013 6:46:30 PM</td>
</tr>
<tr>
<td class="label">Postfix:</td>
<td>val</td>
</tr>
</table>
<h2><span onclick="togg('props_24')" style="cursor:pointer">Properties</span> <a href="#class_24" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="props_24" style="display:none; border: 1px solid #888888" class="table alwaysPrint" cellspacing="0" cellpadding="3" border="0">
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property">reflectItemPostfix</td>
<td class="type"><span class="type">string</span></td>
<td>the prefix for each item within the summary which is returned on reflection. default = <em>&lt;/li&gt;</em>&nbsp;</td>
</tr>
<tr valign="top">
<td class="property">reflectItemPrefix</td>
<td class="type"><span class="type">string</span></td>
<td>the prefix for each item within the summary which is returned on reflection. default = <em>&lt;li&gt;</em>&nbsp;</td>
</tr>
<tr valign="top" style="background-color:#EEEEEE">
<td class="property" style="font-weight:bold;" title="The default property">valid</td>
<td class="type"><span class="type">bool</span></td>
<td>GET:  indicates if the validator is valid (contains no invalid fields)&nbsp;</td>
</tr>
</table>
<h2><span onclick="togg('meths_24')" style="cursor:pointer">Methods</span> <a href="#class_24" class="notForPrint" style="text-decoration:none;">^</a></h2>
<table id="meths_24" class="table methods alwaysPrint" style="display:none" cellpadding="3" cellspacing="0" border="0">
<tr>
<td>
<div class="mName"><a href="#method_IDAWVYOI" onclick="togg('mdetails_24IDAWVYOI')">add
										(fieldName, errorDescription)
									</a></div>
<div class="mDesc">Adds a new invalid field. only if it does not exists yet.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_24IDAWVYOI">
<div class="param"><span class="paramName">byVal fieldName</span><span>
														[<span class="type">string</span>]</span><br>the name of your field. leave <em>empty</em> if you want the field be auto-generated.</div>
<div class="param"><span class="paramName"> errorDescription</span><span>
														[<span class="type">string</span>]</span><br>a reason why the field is invalid</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br><em>true</em> if added, <em>false</em> if not added (because already exists)</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAWTYOI" onclick="togg('mdetails_24IDAWTYOI')">getDescription
										(fieldName)
									</a></div>
<div class="mDesc">Returns the description of the error for the requested-field.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_24IDAWTYOI">
<div class="param"><span class="paramName"> fieldName</span><span>
														[<span class="type">string</span>]</span><br>the name of your field to get the error-description for.</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>the description of the error for the requested-field. <em>empty</em> if there isnt any error</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDACXYOI" onclick="togg('mdetails_24IDACXYOI')">getErrorSummary
										(overallPrefix, overallPostfix, itemPrefix, itemPostfix)
									</a></div>
<div class="mDesc">Returns a custom formatted error summary.</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_24IDACXYOI">usefull if you want to show the errors for example in a HTML list. Summary will be just
returned if there is at least one error (so at least one field must be invalid).<br><br><div class="param"><span class="paramName"> overallPrefix</span><span>
														[<span class="type">string</span>]</span><br>prefix for the whole summary e.g. <em>&lt;ul&gt;</em></div>
<div class="param"><span class="paramName"> overallPostfix</span><span>
														[<span class="type">string</span>]</span><br>postfix for the whole summary e.g. <em>&lt;/ul&gt;</em></div>
<div class="param"><span class="paramName"> itemPrefix</span><span>
														[<span class="type">string</span>]</span><br>prefix for each item <em>&lt;li&gt;</em></div>
<div class="param"><span class="paramName"> itemPostfix</span><span>
														[<span class="type">string</span>]</span><br>prefix for each item <em>&lt;/li&gt;</em></div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">string</span>]
											<br>formatted error summary</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAETYOI" onclick="togg('mdetails_24IDAETYOI')">getInvalidData
										()
									</a></div>
<div class="mDesc">Returns a <em>dictionary</em> with all invalid-fields</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_24IDAETYOI">
<div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="http://www.w3schools.com/asp/asp_ref_dictionary.asp" target="_blank">dictionary</a>]
											<br>All descriptions and fieldnames of invalid fields</div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDAUUYOI" onclick="togg('mdetails_24IDAUUYOI')">isInvalid
										(fieldName)
									</a></div>
<div class="mDesc">Checks if a given fiel (or more fields) is invalid</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_24IDAUUYOI">
<div class="param"><span class="paramName">byVal fieldName</span><span>
														[<span class="type">string</span>, <span class="type">array</span>]</span><br>the name of your field to check (case insensitive). can also be an <em>array</em> with names</div>
<div class="return"><span class="returnName">Returns </span>
											[<span class="type">bool</span>]
											<br><em>true</em> if the field is invalid otherwise <em>false</em></div>
</div>
</td>
</tr>
<tr>
<td>
<div class="mName"><a href="#method_IDA2YYOI" onclick="togg('mdetails_24IDA2YYOI')">reflect
										()
									</a></div>
<div class="mDesc">Reflection method which can be used by JSON (e.g. returning the validator as a whole on a callback)</div>
<div style="display:none" class="mdetails alwaysPrint" id="mdetails_24IDA2YYOI">as the class has no real properties the status is exposed with:
<li class="list"><em>data</em>: holds a dictionary with the invalid fields</li>
<li class="list"><em>valid</em>: indicates if its valid or not</li>
<li class="list"><em>summary</em>: holds a summary of the invalid data (<em>reflectItemPrefix</em> and <em>reflectItemPostfix</em> can be used to format the items)</li>
Example of returning it on callback (server-side asp):
<div class="code"><pre><code>
&lt;%
sub callback(a)
    set v = new Validator
    if str.parse(age, 0) &lt;= 0 then v.add &quot;age&quot;, &quot;Age is invalid&quot;
    page.return v
end sub
%&gt;
</code></pre></div>
Afterwards the validator can be accessed directly within the javascript callback.
e.g. update a HTML list with the error summary of the validator (javascript):
<div class="code"><pre><code>
function validated(val) {
    if (val.valid) $('someList').update(val.summary);
}
</code></pre></div><br><br><div class="return"><span class="returnName">Returns </span>
											[<a class="type" href="http://www.w3schools.com/asp/asp_ref_dictionary.asp" target="_blank">dictionary</a>]
											<br>Returns a <em>dictionary</em> with the class properties and its values</div>
</div>
</td>
</tr>
</table>
</fieldset>
</div>
</td>
</tr>
</table>
</body>
</html>
